Here is a solution a get from Apple DTS. I don't like it, because it is suggests to use absolute path. But I still publish it here, maybe someone feels it is right for him.
How to set up the static library:
- Add a build configuration named "Archive" by copying the Release Configuration.
- Move your headers to the Project group of the Copy Headers build phase.
- Set the Per-configuration Build Products Path of the "Archive" configuration to $(BUILD_DIR)/MyLibBuildDir. Xcode will create the MyLibBuildDir folder inside the BuildProductsPath, then add your static library into that folder. You can use "MyLibBuildDir" or provide another name for the above folder.
- Set Skip Install to YES for all configurations.
- Set Installation Directory of "Archive" to $(TARGET_TEMP_DIR)/UninstalledProducts.
- Edit its scheme, set the Build Configuration of its Archive action to "Archive."
How to set up the project linking against the library:
- Add a build configuration named "Archive" by copying the Release Configuration.
- Set the Library Search Paths of "Archive" to $(BUILD_DIR)/MyLibBuildDir.
- Set the User Header Search Paths to the recursive absolute path of your root of your workspace directory for all configurations.
- Set Always Search User Paths of "Archive" to YES.
- Set Skip_Install to NO for all configurations.
- Edit its scheme, set the Build Configuration of its Archive action to "Archive."