tags:

views:

33

answers:

2

XCode newbie question here: If I'm programming in C++ or objective C, and I #include or #import a library; e.g.

#include <iostream>
#import <Cocoa/Cocoa.h>

I'm often not sure where to look for these header files in the directory structure on my Mac. In other development environments, you can right click the included or imported filename and have the option to jump to source. Is there an equivalent feature in XCode?

Also, for the standard C++ libraries and the Cocoa framework, is the source code for the implementation files available, or only the headers together with compiled link libraries?

Thanks!

+3  A: 

For Apple frameworks, the headers are available. You can also option-double-click on a method or selector to get to either Apple documentation or to the relevant entry in the associated header file.

Alex Reynolds
+1  A: 

Holding option and double clicking on a function is a great way to see a document snippit, pictured below. You can hit the book button from there to see the whole documentation item.

But that doesn't have the source. To answer your question, what you might try is the button with the .h on it, pictured above the NSURLConnection.h box, It should pop you into the source for the file displayed in that title.

alt text

editor
This is true for Apple frameworks. For non-Apple frameworks or libraries, the pop-up will give you the option of looking at the relevant header more directly.
Alex Reynolds
Thanks to both of you -- This is exactly what I was looking for!
Jan Hettich
You can command-double-click a symbol to see its definition in the header and you can option-command-double-click a symbol to go straight to the documentation for that symbol.
Rob Keniger