user523234
user523234

Reputation: 14834

Jump To Definition in Xcode

Let's say in a target, I have 4 classes: class1, class2, class3, class4. All have a same public method (declared in .h files).

In class1.m file, if I right click on a method name in the line below and chose "Jump To Definiton".

[self methodName];

Xcode jumps to the method in other randomly chosen class (class2.m , class3.m, class4.m). It did not jump to the method in the same class.

Any explanations why it behaved this way?

Edit:

  1. It also happened if you do a CMD + click.

  2. And the same with ...@selector(methodName)...

Upvotes: 1

Views: 805

Answers (1)

joelg
joelg

Reputation: 1094

I think it just doesn't have enough context to know where it should go.

Have you tried CMD + click the method you want to jump to? If there are multiple possibilities, it should present you with a pop-up list to choose from.

Edit: when the same thing occurs to me, I just resort to CMD+SHIFT+F and enter the method name as a search term and go from there. Not sure what else to suggest.

Upvotes: 1

Related Questions