views:

799

answers:

4

What is the quickest way to jump to a particular symbol/selector/class in Xcode? (I'm looking for keyboard shortcuts preferably).

Right now, I know two ways of doing this:

  • “Open Quickly” > Click on the Symbols dropdown menu at the top of the editor > Select the selector to jump to it.
  • Click on “Project Symbols” in the “Groups and Files” section on the left sidebar, and type in a name in the Search text field in the top right of the XCode window.

Is there a quicker way of doing this? (If I could even assign a shortcut to jump to the “Project Symbols”, that would suffice for me. Alternatively, if I can find a keyboard shortcut to jump to the symbol dropdown above an editor that would do it to).

For experienced Xcode programmers, what do you use to jump to a symbol?

+1  A: 

One (arguably crude) way to do it seems to be as follows:

This is based on the fact that the Search field at the top right of the Xcode window seems to change behavior depending on what is selected in the Groups & Files sidebar.

  • Select “Project Symbols” in the “Groups & Files” sidebar
  • Press ⌥⌘F (That is Command+Option+F) to jump to the Search field
  • Enter the symbol to jump to, and an outline will quickly show up

(this will remain in effect until you click on something else in the Groups & Files sidebar)

Nocturne
+5  A: 

In Xcode 3.2, the "Open Quickly" command (Shift-Control-D) lets you type in selectors and class names as well as file names. This would at least get you close to what you wanted.

Your idea about using the "Symbols" drop-down also works. You can use the keystroke Control-2 to bring up the Symbols drop-down menu, and then use the arrow keys, or start typing the name of the method that you want to reach.

e.James
Control+2 did the trick. Thanks :) (It was earlier mapped to switch Spaces for me). Curiously, is this documented anywhere?
Nocturne
I don't think so. I did a quick check through the "key bindings" in Xcode when I posted this answer, but that particular keystroke doesn't even show up in the list. Anyway, I'm glad it works :)
e.James
@eJames The Control-2 keybinding should be under the Text Key Bindings tab as Pop Symbols Popup.
Ashley Clark
@Ashley Clark: And so it is! I didn't even see the "Text Key Bindings" tab the first time around. Thank you for pointing it out.
e.James
+2  A: 

If you're looking at the symbol in a source file and want to jump to its definition, ⌘-double-click it.

Peter Hosey
+1  A: 

(command + double click) on your symbol/selector/class in any place of your implementation to jump to them (option + double click) on framework classes/selectors to jump to their reference in help->documentation

cocoatoucher