Xcode question: Quickly jump to a particular selector/class/symbol?

11,981

Solution 1

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.

Edit: In Xcode 4, the "Symbols" drop-down appears when pressing Control-6. You can change this in the Xcode settings by changing the key binding for "Standart Editor > Show Document Items".

Solution 2

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

Solution 3

(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

Solution 4

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)

Share:
11,981
Debajit
Author by

Debajit

Updated on July 27, 2022

Comments

  • Debajit
    Debajit almost 2 years

    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?

  • Debajit
    Debajit almost 15 years
    Control+2 did the trick. Thanks :) (It was earlier mapped to switch Spaces for me). Curiously, is this documented anywhere?
  • Mathias
    Mathias almost 15 years
    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 :)
  • Ashley Clark
    Ashley Clark almost 15 years
    @eJames The Control-2 keybinding should be under the Text Key Bindings tab as Pop Symbols Popup.
  • Mathias
    Mathias almost 15 years
    @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.
  • RyanWilcox
    RyanWilcox about 12 years
    As another update, Control+6 is now a key binding under the View Menu -> Standard Editor -> Show Document Items, in XCode 4.3
  • Nick
    Nick almost 11 years
    Is there a way to do this in Xcode 4 using a key stroke when the symbol is selected instead of command+clicking?