Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

< Previous PageNext Page > Hide TOC

Framework-Style Headers

One important transition in moving to Mac OS X development is the switch from including individual headers to including framework-style headers in your source code files. A framework is a type of bundle that packages shared resources, such as a dynamic shared library and its associated resource files, header files, and reference documentation. An umbrella framework is a framework that includes a number of related frameworks. The Carbon framework (Carbon.framework) is an umbrella framework that contains just one header, Carbon.h. That header in turn includes headers from many additional frameworks, such as Core Services, HIToolbox, and others.

A framework-style include statement specifies a framework (typically an umbrella framework) and its main header file. For example, a Carbon source file should use the statement #include <Carbon/Carbon.h>, rather than separate include statements for each individual header file it may require. Using framework-style includes will help ensure that your project builds correctly and remains reliable over time.

Note: You can add system frameworks by dragging them into the Groups & Files list of your Xcode project (from /System/Library/Frameworks), or with the Project > Add to Project menu item.

For related information, see “Header Files,” “Precompiled Headers and Prefix Files,” “Cross-Development,” “Use Framework Headers,” and “Use C99 Standard in Language Settings.” For more information on frameworks in Mac OS X, see Framework Programming Guide.



< Previous PageNext Page > Hide TOC


Last updated: 2006-10-26




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2007 Apple Inc.
All rights reserved. | Terms of use | Privacy Notice