Taking Notes

cause i'll forget

Xcode Symbol Navigator and Callers

Xcode has a whole lot of UI and it’s not exactly all easy to discover. Here’s a cool trick you can do with the symbol navigator to find out all the places in your code that you’re calling a given method on a given class.

Here’s an example from a project I have with a class called KATGShow with the method - (KATGShowObjectStatus)showStatusBasedOnNotification:(NSNotification *)note checkRelationships:(bool)checkRelationships

Xcode Editor Initial State

Reveal the symbol navigator and switch into assistant editor mode

Xcode Editor Symbol Navigator and Assistant Mode

Select the method (in this case -showStatusBasedOnNotification:checkRelationships:) and from the context menu select Reveal in Symbol Navigator

Xcode Editor Reveal in Symbol Navigator Context Menu

Now with the symbol selected in the left pane, select the context menu for the right editor pane and under Callers you’ll see a selectable list of every call to that method

Xcode Editor Callers Context Menu Xcode Editor Caller

This example is really simple, but in a large code base where many method names are similar and find isn’t cutting it, this is an invaluable part of my workflow.