iOS Engineering Development Notes < two >

Source: Internet
Author: User

In Xcode 4, 5 of the template works can be seen in the Precompile Prefix Header, but in Xcode 6 is removed.

The main reasons for Xcode 6 to remove the Precompile Prefix header are:

(1) Remove the auto-Import System Framework class Library header file, can improve the reuse of the original file, easy to migrate.

(2) An obese prefix header will greatly increase the build time.

To replace the framework that is automatically imported in the prefix header, you can manually import it through #import in each file that needs to import the system framework, ensuring that the Enable modules in build settings is turned on.

If you import in the prefix header, we can get the right to use it for free in every file in the project, without having to manually import it in each of the. h/.m files. The document does have its place of convenience.

If you must use the prefix header file, we can configure it manually.

    1. Add a PCH file to the project, naming or following the template for Xcode 5: project name-prefix.pch, such as a-prefix.pch
    2. Set Build Settings

Set the Precompile Prefix header to Yes, then the PCH will be precompiled and the precompiled PCH file will be cached to improve the compilation speed. You can see from the following build log:

If the precompile Prefix header is no, then each. m file that references the PCH content compiles the PCH one time, and perhaps Apple does a different caching mechanism, but it also slows down the compilation.

Since the Apple standard suggests that we don't need a PCH, try to use it sparingly. Of course, if you must use, or minimize the content in the PCH file, reduce the project to the PCH file dependency, easy to transfer and decoupling later.

iOS Engineering Development Notes < two >

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.