Reputation: 10116
If you have a method, e.g., loadMediaImages
in a .h
file, how do you find all references to that method in the project? In Visual Studio there is a "Find All References" option on the content menu when you highlight and click the method name. Anything similar in Xcode?
Upvotes: 6
Views: 7289
Reputation: 349
Find selected symbol in workspace is what you need
Does basically the same search as Refactor -> Rename does
Upvotes: 2
Reputation: 15589
I was looking for similar option. I do not know why Xcode did not included that. But there is a work around I use until Apple give that option in Xcode.
Try this in the source code (.m) file,
Select the symbol, right click -> Refactor -> Rename
-> Give a name whatever you wish, then press Preview.
Now you can see all the references. You can Cancel
/do not rename it. :)
Or press Cmd + Shift + F
, and choose optons Find > References > Matching or Containing. But it will search all text with similar name. Not elegant like Refactoring.
Upvotes: 3
Reputation: 6206
Using the "Search Navigator" it's possible to search for symbol references within a project or workspace. Click on the little magnifying glass icon in the search box to "Show Find Options", and then select the Style: Symbol References.
Note: This is in Xcode 4.6, but may have been present in earlier versions.
Upvotes: 5
Reputation: 55334
If I'm not mistaken, Xcode 4 (not sure about previous versions) does not support a Find All References search. You can perform a text search within the entire project by pressing Shift+Cmd+F (Find in Workspace in the Edit menu), but this does not find exact "references", just matching text. You're best bet is using the Refactoring menu, as talked about in Finding all references of a variable or a method in Xcode4, but it is not very clean and requires more work than it should.
Upvotes: 0