JHollanti
JHollanti

Reputation: 2413

Xcode, see where a method is used

I have a method in some class and i would like to see exactly where it is being used. Compared to Java and Eclipse you can simply tell it to show all the references and even a call hierarchy of a method. Is there anything similar in Xcode?

I know that Objective-C does not follow the same ways of identifying method signature as Java does (i.e. there is no method to a class, just a bunch of selectors mapped to an id at runtime), so i'm having a hard time trying to figure out how Xcode could even accomplish this.

Upvotes: 6

Views: 1409

Answers (2)

djromero
djromero

Reputation: 19641

Look here:

enter image description here

There is no equivalent menu or context menu. In addition to callers you can access callees, superclasses, etc.

If you don't use Ctrl-1 for Spaces you can access that menu with it.

Note that you need to use the Standard or Assistant Editor: enter image description here

Callers and callees are not shown if the Version Editor is selected: enter image description here

Upvotes: 7

Chris Trahey
Chris Trahey

Reputation: 18290

Your best bet is likely string searching, but realize that you can use patterns (click the little magnifying glass in the search bar in the file browser pane).

You've hinted at one of the reasons it's so hard to do otherwise. Objective-C's runtime allows many different ways of finding and executing code.

Upvotes: 0

Related Questions