Is there a way to jump to a specific method in Xcode?

I think this is what you're looking for:

Type ctrl-6 to activate the "Show Document Items" in the "Jump Bar". Then start typing part of the method you are looking for to narrow the results.

Example:

To jump straight to - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

Type ctrl-6, type "cellFor", arrow down so the method is highlighted, and press Enter. The Editor will jump right to that method.

Incidentally, you can use ctrl-1, ctrl-2, ctrl-3, etc. to access the different sections of the "Jump Bar".


If I understand you correctly, try Command-Shift-O. It also doubles as a file finder.


Perhaps I'm not understanding what you need, but it seems like you have a couple of options.

  • Control+Command+J should take you to a definition.
  • Control+Command+Up/Control+Command+Down will toggle between .h/.m files.
  • While in the .m file, I use the dropdown for the methods often.

If you want to press a command key sequence like Command + Option + to jump to the next method, or Command + Option + to jump to the previous method, there is no such animal in Xcode. Prior macOS development tools had such a capability, but Xcode is seriously lacking in the basics...

The fastest jump back and forth in methods in a source file is to perform a Command + F (Find) on [\-\+][ \t]*\( as a regular expression. Then you can Command + G (Find Next) to go to the next method or Command + Shift + G (Find Previous) to go to the prior method.

If you are disciplined in your method definitions, you might be able to search for - ( or + ( as a normal text string instead... a tad faster.

If this is a serious itch to scratch, maybe it is worth creating an Xcode plugin (as silly as this sounds for such a basic feature)... and post a link here for the rest of us ;-)