Xcode6 PCH File

Source: Internet
Author: User

 

When you create a project in xcode5, the system automatically creates a PCH (precompile prefix header) file named by the project name, during development, you can include widely used header files and Macros in this file, and the compiler automatically adds the header files in the PCH file to all source files, in this way, you can directly use the content in the header file without using import when you need to use the relevant classes, which brings programming convenience to the programmer. However, the precompile prefix header file is removed from xcode6. Xcode6 removes the precompile prefix header mainly because the prefix header greatly increases the build time. Without the prefix header, you must manually import the header file through @ import. This reduces the build time while losing programming convenience. In xcode6, how does one manually add a precompile prefix header?(1) Add a PCH file to the project. You can continue to use "project name-prefix" in xcode5. PCH ": (2) modify the project configuration file and add the path of the created PCH file to the precompile header option in building setting (Add" $ (srcroot) to the path) /Project name/PCH file name): Note: After my test, the label here is selected to combined to add the path so far. After manually adding the PCH file, compile the program, if an error occurs, check whether the added path is correct. Note that when precompile prefix header is switched, the PCH compilation and import mechanisms are quite different: (1) if precompile prefix header is yes, PCH will be pre-compiled, the pre-compiled PCH file will be cached to increase the compilation speed. (2) If the precompile prefix header is no, PCH will not be pre-compiled. Instead, it will be compiled once in every. M file of the framework class library used for its import, reducing the compilation speed. Conclusion: Since Apple removed the precompile prefix header file from xcode6, you can use as few PCH files as possible during the development process. If you want to use it, try to reduce the content in the PCH file as much as possible, reduce program dependency on PCH files.Reference: http://blog.csdn.net/jymn_chen/article/details/39314163

Xcode6 PCH File

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.