Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I know who calls the method in Xcode?

Tags:

xcode

Does Xcode have a way to show the caller function of a method? I want to know all of the calling functions of a method in a class. A solution would be to find the method in the project, but sometimes different classes have methods with the same name - That could find us a method we're not looking for..

Many other IDEs have this capability, such as Visual C++ 2003/2005/2008,Eclipse ...

Can you do this in XCode?

like image 395
qiushuitian Avatar asked Aug 17 '12 03:08

qiushuitian


1 Answers

Xcode 4.4 intrudced this functionality: New Features in Xcode 4.4 (Scroll down to 'Find and Search Additions')

  1. Move your cursor on top of the function you are interested in

  2. Open the Assistant editor( ++Enter)

  3. On the top of the assistant editor, Select 'Callers'
    Assistant editor - Callers

  4. You will see a list of all the function that's calling your function
    Assistant editor - dropdown

Not the as effective as other IDEs, but does the job.

like image 90
Eldad Avatar answered Oct 14 '22 09:10

Eldad