What exactly is a Framework in Mac OS X? ( *.framework folders )

On Mac OS X, a framework is a versioned, bundled library. As you’ve noticed, some frameworks are quite simple and contain only header files and the library itself for a single version. Other frameworks can have multiple versions, multiple library files, subframeworks (in this case the parent framework is also called an umbrella framework), and resource files such as images or localised strings.

More information available in the Framework Programming Guide.


It is, quoting "Mac OS X Technology Overview":

framework A type of bundle that packages a dynamic shared library with the resources that the library requires, including header files and reference documentation.

So a ".framework" is basically the equivalent of a ".app", only for a dynamic shared library instead of an executable.


Framework Information

From the Apple Developer Connection: Framework Definition:

A framework is a bundle (a structured directory) that contains a dynamic shared library along with associated resources, such as nib files, image files, and header files. When you develop an application, your project links to one or more frameworks. For example, iPhone application projects link by default to the Foundation, UIKit, and Core Graphics frameworks. Your code accesses the capabilities of a framework through the application programming interface (API), which is published by the framework through its header files. Because the library is dynamically shared, multiple applications can access the framework code and resources simultaneously. The system loads the code and resources of a framework into memory, as needed, and shares the one copy of a resource among all applications.

alt text

From the Framework Programming Guide: What are Frameworks?:

Frameworks offer the following advantages over static-linked libraries and other types of dynamic shared libraries:

  • Frameworks group related, but separate, resources together. This grouping makes it easier to install, uninstall, and locate those resources.
  • Frameworks can include a wider variety of resource types than libraries. For example, a framework can include any relevant header files and documentation. Multiple versions of a framework can be included in the same bundle. This makes it possible to be backward compatible with older programs.
  • Only one copy of a framework’s read-only resources reside physically in-memory at any given time, regardless of how many processes are using those resources. This sharing of resources reduces the memory footprint of the system and helps improve performance.

Related SO Question

You might want to look at SO question 1444543: Differences between Framework and non-Framework builds of Python on Mac OS X.