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

< Previous PageNext Page >


Types of Bundles

Mac OS X recognizes at least three distinct types of bundles:

Although bundles can have any extension, there are some conventions. For example, applications typically use the .app extension. You can use other extensions for applications, as long as the application’s Info.plist file has a CFBundlePackageType key with the value “APPL”. The traditional extension for frameworks is .framework. Plug-ins and other loadable bundles can have any extension, but it should be an extension claimed by an application that knows how to load the bundle. The generic extension for loadable bundles is .bundle.

In this section:

An Application’s Main Bundle
Framework Bundles
Loadable Bundles and Dynamic Linking

An Application’s Main Bundle

With the exception of most command-line tools, every application has at least one bundle—its main bundle—which is the folder where its resources and executable files are located. Application bundles should have an extension of .app (for shipping applications), .debug (for applications with debug symbols), or .profile (for applications with profiling data). The Finder hides the .app extension from users.


Framework Bundles

Frameworks are bundles that package dynamic shared libraries, interface-definition files, images, and other resources that support the executable code along with the header files and documentation that describe the associated programming interfaces. As long as your applications are dynamically linked with frameworks, you should have little need to do anything explicitly with those frameworks thereafter; in a running application, the framework code is automatically loaded and linked, as needed. Frameworks should have an extension of .framework.


Loadable Bundles and Dynamic Linking

In addition to the main bundle and the bundles of linked-in frameworks, an application can be organized into any number of other bundles. Although these loadable bundles usually reside inside an application file package, they can be located anywhere in the file system (but typically are put in the /Library/Extensions directory of a file-system domain). An application can dynamically load the code and resources in a bundle when it needs them. For example, an application for managing PostScript printers may have a bundle containing PostScript code to be downloaded to printers.

The executable code in loadable bundles can be dynamically linked into an application while it runs. Using various code-loading programming interfaces, functions from loadable bundles can be looked up by name and called through function pointers. This newly linked code can then use a bundle identifier to obtain an instance for its bundle. Through this bundle instance, the code can locate and load additional resources packaged in the bundle.

Loadable bundles should have an extension. The conventional extension for loadable bundles is .bundle and, for Interface Builder palette bundles,.palette. Although the extension can be anything, it ideally should be an extension claimed by one or more applications that can load the bundle. These bundles are then associated with your application (by the Finder) and your application launches (if not started) and loads them when the user double-clicks them.



< Previous PageNext Page >


Last updated: 2003-08-21

Get information on Apple products.
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Copyright © 2003 Apple Computer, Inc.
All rights reserved. | Terms of use | Privacy Notice