I have received this message ever since I started building my first iPhone program several months ago.
I want to check if a delegate implements a given method. It works but I get this warning.
How can I do it the correct way?
The respondsToSelector:
method is declared in the NSObject
protocol. You have to make sure that your custom protocols also conform to the NSObject
protocol. Change the declarations of your custom protocols from:
@protocol MyCustomProtocol ... @end
to:
@protocol MyCustomProtocol <NSObject> ... @end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With