This article is original. repost the famous source.
This article explains how to configure Project Association in the workspace of xcode4, but this is not the only method.
Create a workspace, add an iOS lib project called LIBA, add an iOS lib project called libb, and then add an app project called APPC.
Scenario: the APPC project uses the libs generated by the LIBA and libb projects.
Both lib projects are configured in the same way. Here we use LIBA as an example:
1. Set the public headers of Lib.
2. Select the target of the LIBA project and set installation directory to $ (built_products_dir) in build settings)
Configure the APPC project:
First, link the APPC to each Lib:
1. Select the target-APPC of the APPC project and add libliba. A and liblibb. A to link binary with libraries of build phases.
Then let the APPC see the public header files of each Lib:
1. Select the APPC project and click Add target: IOS, other, and aggregate next. The target is named runscript.
2. Select the target-runscript of the APPC project and open add build phase/Add run script under build phases.
The input script is as follows:
Rm-RF $ {project_dir}/$ {project_name}/libsheaders/
Mkdir $ {project_dir}/$ {project_name}/libsheaders/
CD $ {built_products_dir}
Find.-Name"*. H"-Exec CP'{}'$ {Project_dir}/$ {project_name}/libsheaders /\;# Copy all the Lib's public header files.
3. select target-APPC for the APPC project,
Add target-runscript to target dependencies of build phases.
Set always search user paths to yes in build settings, and set user header search paths to $ {project_dir}/$ {project_name}/libsheaders/
(That is, the target directory of the header file copied by the above script)
End