Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'-respondsToSelector:' not found in protocol(s)

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?

like image 702
gyozo kudor Avatar asked Jun 17 '10 11:06

gyozo kudor


1 Answers

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 
like image 162
Ole Begemann Avatar answered Oct 04 '22 11:10

Ole Begemann