Libraries and Frameworks

Projects you build with Project Builder link against Mach-style dynamic libraries. Rather than #include-ing flat header files, though, projects usually link against Frameworks, which include both libraries and related resources.[23] (See the /Developer/Headers folder, described earlier in Section 15.2, for a fast way to port flat-library-linking legacy code.)

Frameworks

Frameworks are simply dynamic libraries packaged into bundles. Along with the library file itself lives its related resources. Like all bundles, frameworks use a consistently named internal structure of folders, so that programs can easily find what they need within. These resources can include images, plists, and NIB files, just like an application bundle. This not only makes shared code libraries possible, but also complete shared interface libraries. The standard spell checker interface, for example, actually lives as a NIB file within the Application Kit (or AppKit) framework’s resources.

Resources particular to framework bundles—and of interest to developers wishing to make use of them in their software projects—include the library’s header files and class documentation. You can navigate to and open these from the Finder if you’d like, but Project Builder gives you easier ways to browse these framework resources if you’ve loaded a reference to the framework into your project. Clicking the disclosure triangle next to a framework icon in the Files tab reveals that framework’s headers, ...

Get Mac OS X in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.