开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜