Hello i have received this message ever since i started building my first iphone program several months ago. I check if a delegate implements a given method. It works but I get this warning. How can i do it the correct way? Thanks in advance.
+1
A:
I suppose respondsToSelector is a method of NSObject, and I guess that you have something like id<MyProtocol>
as the type? Try NSObject*<MyProtocol>
.
Krumelur
2010-06-17 12:01:06
+10
A:
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
Ole Begemann
2010-06-17 12:03:05
Thanks, it works
kudor gyozo
2010-06-17 12:44:40