Add. pch and xcode6.pch in Xcode6

Source: Internet
Author: User

Add. pch and xcode6.pch in Xcode6
When you create a project in Xcode5, the system automatically creates a pch file named after the project, but removes the Precompile Prefix Header file in 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 the "Project name-Prefix. pch" in Xcode5 ":

(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 "):

Now, you have manually added the pch file and compiled the program. If there is an error, check whether the added path is correct.
Note that when Precompile Prefix Header is switched, the pch compilation and import mechanisms are very different:
(1) If the Precompile Prefix Header is YES, pch will be pre-compiled, and the pre-compiled pch file will be cached to speed up compilation. (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

Related Article

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.