Previous Section Next Section Table of Contents Glossary Index

Chapter 14. The Objective-C Bridge

14.7. Loading Frameworks

On Mac OS X, a framework is a structured directory containing one or more shared libraries along with metadata such as C and Objective-C header files. In some cases, frameworks may also contain additional items such as executables.

Loading a framework means opening the shared libraries and processing any declarations so that Clozure CL can subsequently call its entry points and use its data structures. Clozure CL provides the function OBJC:LOAD-FRAMEWORK for this purpose.

(OBJC:LOAD-FRAMEWORK framework-name interface-dir)

framework-name is a string that names the framework (for example, "Foundation", or "Cocoa"), and interface-dir is a keyword that names the set of interface databases associated with the named framework (for example, :foundation, or :cocoa).

Assuming that interface databases for the named frameworks exist on the standard search path, OBJC:LOAD-FRAMEWORK finds and initializes the framework bundle by searching OS X's standard framework search paths. Loading the named framework may create new Objective-C classes and methods, add foreign type descriptions and entry points, and adjust Clozure CL's dispatch functions.

If interface databases don't exist for a framework you want to use, you will need to create them. For more information about creating interface databases, see Creating new interface directories.

Previous Section Next Section Table of Contents Glossary Index