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