Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Finding all references of a variable or a method in Xcode4

There'a a similar question here but I couldn't make use of the answers in XCode 4. I googled it but I couldn't come up with anything useful either. What's your effective method of getting this information?

like image 811
aslisabanci Avatar asked Mar 28 '11 09:03

aslisabanci


People also ask

How do I see references in Xcode?

Open the "Related Files" menu via the icon at the top-left of the Editor. (It's the button immediately to the left of the back button). Go to the "Callers" submenu for a list of all methods that call the selected method, and click any of them to jump to that file and method.

How to search for something in Xcode?

Searching for text in Xcode is quite easy. Type Command-Shift-F and off you go.


1 Answers

Find in project, though if you are searching to change the name everywhere, better would be to use the Refactoring menu.

EDIT: You can use Refactoring to find where a specific variable is referenced. Select the variable and choose Edit->Refactor->Rename. In the refactoring screen, rename the variable (just add _ at the end or something) and click preview. it will show everywhere in the project that variable is referenced. Click on each file to see the lines where the variable is called. After you're done just cancel the refactor.

like image 190
Kirby Todd Avatar answered Sep 17 '22 23:09

Kirby Todd