Reputation: 11148
This Java-Code works:
public void executeCommand(ICommand cmd) { // ICommand is an Interface
if (cmd.getClass().equals(LoginCommand.class)){
}
}
But this Objective-C-Code doesn't work:
- (void)executeCommand: (id<Command>)cmd { // Command is a Protocol
if ([cmd isKindOfClass:[LoginCommand class]]) {
// WARNING: '-conformsToProtocol:' not found in protocol
}
}
Upvotes: 4
Views: 2782