How to stop protocols from generating warnings?
if I have a protocal defined, then it always generate a lot of warnings when compile.
like
@property (retain) id <SomeProc> value
then in the code:
[value class]; ...
[value release]
the compiler always complain it "may not have class or release defined".
Is there a way to fix t开发者_开发百科his?
Yes:
@protocol SomeProc <NSObject>
…
@end
This way your protocol will also contain all the methods required by the NSObject protocol.
精彩评论