I know I need to write:
[delegate respondsToSelector:@selector(myMethod:)]
But the compiler is complaining that respondsToSelector is not a method in the protocol, which is correct, However I have seen many sample code use this, how do you do it?
Your @protocol
needs to implement <NSObject>
, simply update your protocol definition to look like this:
@protocol MyProtocol <NSObject>