I was taking a look at the Xcode b开发者_如何学运维undle and noticed that some of the icons visible on the UI don't exist there, eg, the Run button with the hammer on top.
Where would they be? Where else can you store resources in a Cocoa application?
The developer tools use several private frameworks that are stored in /Developer/Library/PrivateFrameworks
. The resources are loaded from these frameworks. The hammer icon you mention is in:
/Developer/Library/PrivateFrameworks/DevToolsInterface.framework/Versions/A/Resources
This is only possible because Apple creates the entire /Developer
directory structure with an installer, so the location of the shared frameworks is known. Normally you'd include any used frameworks in your application bundle, specifically in the Contents/Frameworks
folder.
精彩评论