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.

Applications sharing code and resources of framework

Because a framework is a bundle, you may access its contents using the NSBundle class or, for procedural code, CFBundle of Core Foundation. You may create your own frameworks for OS X, but third-party frameworks are not allowed on iOS. On OS X, you may browse the contents of a framework in the Finder. When developing for either platform, you may also view the header files of a framework from within the Xcode application.

Prerequisite Articles

Related Articles


Definitive Discussion