Why tack a protocol of NSObject to a protocol implementation

前端 未结 5 421
野性不改
野性不改 2020-12-02 23:01

I have been seeing some code around that resembles the following:

@protocol MyProtocol 
// write some methods.
@end

Is ther

5条回答
  •  臣服心动
    2020-12-02 23:42

    I'm pretty sure the reason you would do this is to add the NSObject members (say like retain and release) to your protocol. Technically you can still send those messages anyways but you will get a compiler warning without it.

提交回复
热议问题