Use and compilation of xcode Workspace

Source: Internet
Author: User
Environment: xcode 4.5 Mac 10.8
1. Static Library
1.1 learn how to use xcode4 to create a static library (5) in Yusong IOS Quick Start development ).
1.2 static library usage. We finally generated the. A file in 1.1, but this is not perfect.
1.2.1 select static library

1.2.2 there are multiple configurations in the static library during build. We generally use Simulator for debugging. file a is red in the project. You also choose device compilation and re-import it in the project (xcode bug !!!).

1.3 Static library ConfigurationIf we want to dynamically compile static libraries and projects in the workspace, We need to configure the two. In the static library, go to the static library-> targets-> build setting-> install directory and type: $ (built_products_dir). Here we specify the. Public file path generated by the static library. In the static library-> targets-> build setting-> Other linker flags, type:-objc. Here we can let the project import all the static library public files (including category ), for details, see solution for category in IOS static library, which cannot be used in the project.
1.4 Set public foldersChoose static library> targets> build phases> copy files and click "+" to add public files. h header file (if you want to use this file in the project), note: Different xcode versions have different methods to add public files.
2. Our project
2.1 For project director. A, see section 1.1
2.2 In the project, choose "targets"> "build setting"> "User header search paths", type, $ (built_products_dir), and the project can be located in this directory, that is, the public file directory that is generated statically finds the file. Similarly, we enter-> targets-> build setting-> Other linker flags in the project:-objc, which is similar to 1.3 here.
3. Run the command line to compile the workspace. When testing and packaging 3.1 At 1.2.2, select static library, navigation bar, product-> edit scheme, as shown in:


Select Info-> build configuration-> release. Here we choose release compilation. In this way, we can find the. A file of release in the specified path during command line compilation.


3.2 find the path of. xcworkspace in the terminal and execute the following command xcodebuild-workspace XXX. xcworkspace-scheme YYY-configuration release
3.3 find the. app in the release-iphoneos file under the $ (built_products_dir) directory. Note: You can specify the $ (built_products_dir) location in xcode-preferences-> locations. For details, see environment variables of xcode4, build settings parameters, workspace and associated editing settings. Figure 3-1 Figure 3-2.

Figure 3-3


Reference: http://erlangprogram.com/use-xcode4-workspacehttps://coderwall.com/p/rv2lgwhttp://blog.carbonfive.com/2011/04/04/using-open-source-static-libraries-in-xcode-4/http://www.cnblogs.com/xiaodao/archive/2012/03/28/2422091.html

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.