Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode find caller functions

Tags:

xcode

In Xcode, how can I find all caller functions of a specific function?

like image 435
genesys Avatar asked Jan 10 '10 19:01

genesys


2 Answers

Xcode 4.5 (in beta) has this functionality. when you highlight say... a function, you can check the "caller" and "callee"

edit i believe it's located at the top left of the file panel for that file... so double click on the function to highlight it, and you click on on the file panel options (the one that has the "open recent, open unsaved...etc" drop down

EDIT #2

here's a picture to clarify (since i dont know what this menu button is called)enter image description here:

ALSO - XCode 4.5 is no longer beta, i believe, and is actually out in public

EDIT #3

also note that this caller thing does NOT search for being called under the performSelector method, as in, the particular caller that has this performSelector won't show up if you had done something like:

[self performSelector:@selector(checkIfShouldStopMovement) withObject:nil afterDelay:0.25]; 
like image 122
David T. Avatar answered Sep 29 '22 23:09

David T.


In Xcode, the quickest method is this:

  1. Select method in code (double click or mark using your mouse cursor)
  2. Press Ctrl+1
  3. Select "Callers" from the pop-up menu.

This is the shortcut for going View -> Editor -> Show Related Items in Xcode's menu.

like image 32
pille Avatar answered Sep 29 '22 22:09

pille