Why tack a protocol of NSObject to a protocol implementation

前端 未结 5 423
野性不改
野性不改 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:27

    If you use any of the NSObject protocol methods such as retain, release, class, classname, the compiler will give you warnings unless your Protocol also includes the NSObject protocol.

提交回复
热议问题