objc_getProtocol() returns NULL for `NSApplicationDelegate\"?

女生的网名这么多〃 提交于 2019-12-05 08:54:24

Found the answer in the Apple docs:

http://developer.apple.com/library/ios/#DOCUMENTATION/Cocoa/Conceptual/ObjectiveC/Chapters/ocProtocols.html#//apple_ref/doc/uid/TP30001163-CH15

The compiler creates a protocol object for each protocol declaration it encounters, but only if the protocol is also:

  • Adopted by a class,
  • Or referred to somewhere in source code (using @protocol())
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!