Linking to a Library or Framework

Link frameworks and libraries with your project’s object files to produce a binary file. You can link a target’s source files against libraries in the target’s active SDK or against external libraries.

To link to a library or framework
  1. In the project editor, select the target to which you want to add a library or framework.

  2. Click Build Phases at the top of the project editor.

  3. Open the Link Binary With Libraries section.

  4. Click the Add button (+) to add a library or framework.

    External libraries and frameworks are those not provided by the active SDK. They aren’t in the list you see when you click the Add button (+), but you can navigate to an external item by clicking the Add Other button below the list.

  5. Select a library or framework from the list and click Add.


Libraries and frameworks are designated as Required by default, but you can change this designation to Optional. Required libraries must be present on the host computer for the product to load. Optional libraries do not have to be present for the product to load. A Required framework will always be loaded into memory, but an Optional framework will be loaded only if needed. The initial load of the application will be faster if a large library that is never needed is designated as Optional.