tags:

views:

615

answers:

5

Does Xcode have a code navigation feature? Like unix's cscope type of tool which I can enter the name of a class and it will open the file for me? Or find out the caller of a particular method of a class? Or show the type hierarchy of a class?

+7  A: 

Command-Shift-D opens a Quick Open window where you can type a partial class name and hit enter to open the file. As far as more complex versions such as what Eclipse offers (method names, symbol names, etc), I don't believe anything like that is built into XCode.

Marc W
You can type symbol names into the Quick Open window and they will generally be found.
Lyndsey Ferguson
+3  A: 

In addition to the Quick Open window, there is the class browser. The class browser allows you to view the class hierarchy. The Class Browser can be found under the Project menu.

Lyndsey Ferguson
+2  A: 

If you Ctrl click a class name, method name or function name you will get a long meny where you can find the Jump to Definition item.

epatel
+2  A: 

The "Jump To Definition" item is accessible through CMD + double click, which takes you directly to the relevant code

Also, you can "Jump To Documentation" by (Option or ALT) + double clicking on a class/method/property

Update: Option + double click no longer takes you directly to documentation in Snow Leopard. Now it opens up a little documentation "bubble", with the option to jump to the documentation browser if needed.

Corey Floyd
Or Option, if you're not using a PC keyboard on your Mac.
Peter Hosey
Yeah, I don't even know why I wrote that. Still working those bad memories out in therapy…
Corey Floyd
+1  A: 

Also: select an identifier, right-click on it, and choose Find in Project > As Symbol (or Find in Project and choose Symbol as the search type) shows all symbolic uses, that is, declarations, definitions, and call sites.

cdespinosa