Reprinted from: http://www.cnblogs.com/yulang314/p/3836123.html
A general application to create a new project, and then put all the program files in the inside, this can meet most common needs, but sometimes the project may have to use other project files, or introduce other static library files, this time workspace will come in handy , workspace can manage multiple projects separately, and can be configured to make each project dependent on each other, if not workspace, the previous practice is if you use other project files, to manually copy files to the current project, in workspace This step is not required.
Here is my own example, now using workspace to manage 2 project, one of which is static library:mystaticlib, the other is the project:myusestatic that relies on this static library, menu Xocde4 > File > New Workspace a new empty Workspace, the name can be taken casually.
On the left side of Project Navigator, right-click New Project, then select Ios > Framework & Library > Cocoa Touch Static Library and enter the project name M Ystaticlib, this creates a new blank static library project, and then creates a new class file with the name Mylib, selects the MyLib.h header, opens the File Inspector window on the right, and membership in Target Mystaticlib The later project is changed to public.
On the left side of Project Navigator, right-click New Project, and then select Ios > Application > Window-based Application, and then enter the project name Myusestatic, which is configured below Make it dependent on mystaticlib, open the Build phases configuration option and then expand Link Binary with Libraries, click + to see Workspace > LIBMYSTATICLIB.A, select it, and let this project produce Has a dependency on mystaticlib and then searches for user_header_search_paths in the Build S setting configuration option, setting its value to the Mystaticlib build Prouect path, When you import a new file in a static library, you will find it in this path.
Compiling myusestatic will now automatically compile the dependent mystaticlib first.