objective c - In Xcode, how do I know which class implement a protocol? -


i wondering in xcode, can know classes implement protocols?

i don't want use search, want identify such classes.

you can use assistant editor:

  • open protocol interested in, place cursor inside @protocol definition
  • open assistant edior (command-option-return) , drop down menu in upper left, select protocols:

enter image description here

the classes implement protocol in list.

edited add info rob's comment:

note finds classes that, either in public header or in implementation declare conform protocol. if conformance protocol declared somewhere else, classes not show up.

say have protocol defined somewhere as

@protocol myprotocol <nsobject> … @end 

a class public header myclass.h show up:

@interface myclass : nsobject <myprotocol> 

also, class extended in .m file show up

@interface myobject () <someprotocol> … @end  @implementation myobject  … @end 

a class extension myclass_extension.h not show up:

@interface myobject (extension) <someprotocol> … @end 

Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -