What does Apple intend to do? XCode6 Discard prefix.pch File

Source: Internet
Author: User

when we upgraded to XCode6, the new project found that the default is no PCH file, many people are not accustomed to, why did Apple want to cancel this PCH file .

Apple believes that becauseComponentthe reason for a single module,you should not put any code in your prefix code, put them in the file you really need to put in. Put your definition in the file that belongs to them. Try not to use macro definitions (define): Unless it is a last resort, (the reason for not using a macro definition here is that the macro definition is processed at pre-compilation time, so when you modify the macro definition, it causes a lot of code to be recompiled. There are many potential bugs in the macro definition because he will not be noticed at the time of precompilation). If you are really forced to use a macro definition, put them in a header file that needs to be include, not in the prefix file.
prefix header files are heavily used by those and almost allSystemmust be used (for example, Foundation.h) in the file. If you have something large in existence, you should rethink your architectural problems. Because when you modify some code of your prefix header, the prefix header causes the entire project to recompile, which makes your code reuse difficult and leads to some trivial build problems. So don't use the prefix header so you can avoid a lot of time to recompile the entire project.
If you still want to use precompilation, you can create a new one and pass it to the front of the compiler, which is rarely seen (I didn't use it), but it's a good way to do it.

If you still insist on using this file, there is a workaround. We need to add them manually and add the steps as follows:






What does Apple intend to do? XCode6 Discard prefix.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.