On May 22, 2009, at 1:26 PM, Michael Crawford wrote: With or without precompiled headers, I always avoid:
#include <Carbon/Carbon.h>
Instead, when I need a framework header, I only include the specific one I need. This takes some extra work in setting up one's Xcode projects, because internal frameworks aren't found by default, but it can be handled by setting the framework search paths appropriately.
By "internal frameworks," I assume you mean "sub-frameworks of umbrella frameworks." In other words, you're talking about frameworks like (say) CoreGraphics.framework, which is a sub-framework of the ApplicationServices.framework umbrella framework.
Don't do that.
When an umbrella framework is provided, that's all that is supported for importing headers from or linking against. That's intentional: Sub-frameworks could move, be renamed, be consolidated, be broken apart, etc. But if you import the umbrella framework header, and link against the umbrella framework, your code and your built product will be safely insulated from that.
Note that this applies to umbrella frameworks that contain other frameworks like Carbon.framework, ApplicationServices.framework, CoreServices.framework, and so on. The Cocoa.framework umbrella doesn't actually contain AppKit.framework, CoreData.framework, or Foundation.framework so it's safe to directly import from or directly link to them. (Though generally apps should just import and link against the Cocoa umbrella.)
-- Chris
|