O'Reilly logo

Beginning Mac OS® X Programming by Drew McCormack, Michael Trent

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

5.1. Basic Bundle Structure

Mac OS X uses bundles for a number of file formats, including applications, frameworks, plug-ins, and certain kinds of documents. You are already familiar with applications and frameworks. Plug-ins are bundles that can be loaded into applications or frameworks at runtime. For example, graphics programs commonly use plug-ins to import functionality into the application. Also, the QuickTime framework can load new codecs, importers, and other things with plug-ins. Some applications use bundles to store document data. For example, Interface Builder .nib files and Xcode project files are both bundles. Not all documents are bundles, however.

Bundles offer a number of different features depending on the specific kind of bundle format in use. No one format takes advantage of all bundle features. The following table outlines the features supported for each bundle format.

 ApplicationsFrameworksPlug-insDocuments
Opaque Directory 
Versioned Bundles   
The Info.plist File 
Executable Code 
Global Resources
Localized Resources 

5.1.1. Opaque Directory

Various parts of the operating system, including the Finder, Dock, and Open / Save panels can treat a bundle directory as if it really were a single file. This prevents people from casually viewing a bundle's contents and making changes to its files and directories. Because users can't see inside these bundles, we refer to them as opaque directories.

Opaque directories are common for applications, plug-ins, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required