Tuesday, November 8, 2011

Developing a Static Library and Incorporating It in Your Application in Xcode4

Developing a Static Library and Incorporating It in Your Application

From: http://developer.apple.com/library/ios/#documentation/Xcode/Conceptual/ios_development_workflow/910-A-Developing_a_Static_Library_and_Incorporating_It_in_Your_Application/archiving_an_application_that_uses_a_static_library.html

When you need to develop a static library to use in an application and you have to have separate projects for each product, you can use a workspace to contain both the static library project and the application project. If you do, ensure that you configure the projects in the workspace as described here:

  1. In the target that builds the static library, ensure that:

    • The exported headers are in the Project group in the Copy Headers build phase.

    • The Skip Install build setting is set to Yes.

  2. In the target that builds the application, ensure that:

    • The User Header Search Paths build setting is set to the recursive absolute path of a directory under which the static library’s header files are stored.

      Important: If you move your static library project directory to a different location in your file system, you must update the value of the User Header Search Paths build setting to reflect the new location of the static library’s header files.

    • The Always Search User Paths build setting is set to Yes.

    • The Skip Install build setting is set to No.

  3. In the scheme that builds the application, ensure the scheme also builds the static library for archiving.

    image: ../art/scheme_editor-archiving_a_static_library.jpg

Content specifications: This content is written for Xcode 4.0.2 and iOS SDK 4.3.

Posted via email from Troy's posterous

No comments:

Post a Comment

Google+