Work together with multiple project workspace with Xcode

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.