Xcode6 importing. pch files (precompile Prefix Header)

Source: Internet
Author: User

When you create a project in Xcode5, the system automatically creates a PCH (precompile Prefix header) file with the name of the project, which you can use to include a widely used header file and a macro in the development process. The compiler will automatically add the header files in the PCH file to all the source files, so that the contents of the header file can be directly used without using import when the relevant class needs to be used, to a great extent to the programmer's convenience of programming. However, the Precompile Prefix header file is removed from the Xcode6. The main reason Xcode6 removed precompile Prefix header might be that the Prefix header greatly increased the build time. Without the prefix header, manual @import will be manually imported to the header file, losing programming convenience while reducing the build time. How do I manually add the precompile Prefix Header in Xcode6? (1) In the project to add a PCH file, the name can continue to follow the XCODE5 "project name-prefix.pch":

(2) Modify the project configuration file, add the path of the PCH file you created to the Precompile header option in building setting (Path Add "$ (srcroot)/project name/PCH filename"):

This completes the manual add PCH file, compile the program, if there is an error check the correct path is added. Note here that the compile and import mechanism of the PCH is very different when the switch precompile Prefix header:
(1) If the Precompile Prefix header is yes, the PCH will be precompiled and the precompiled PCH file will be cached to improve the compilation speed. (2) If the Precompile Prefix header is no, then the PCH is not precompiled, but is compiled once in each of the. m files used in the Frame class library it imports, reducing compilation speed. Summary: Since Apple in the Xcode6 removed the precompile Prefix header file, in the process of development can minimize the use of PCH files, if you want to use also to minimize the contents of the PCH file, reduce the program to PCH file dependency. Reference from: http://blog.csdn.net/jymn_chen/article/details/39314163 to: http://blog.csdn.net/tmweipan/article/details/39761843

Xcode6 importing. pch files (precompile Prefix Header)

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.