开发者

Xcode: How to find the source code for standard or system libraries?

Xcode 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 of开发者_Python百科ten 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?


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.


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.

Xcode: How to find the source code for standard or system libraries?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜