When you create a project in xcode5, the system automatically creates a PCH (precompile prefix header) file named by the project name, during development, you can include widely used header files and Macros in this file, and the compiler automatically adds the header files in the PCH file to all source files, in this way, you can directly use the content in the header file without using import when you need to use the relevant classes, which brings programming convenience to the programmer. However, the precompile prefix header file is removed from 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 "project name-prefix" in xcode5. PCH ": (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): Note: After my test, the label here is selected to combined to add the path so far. After manually adding the PCH file, compile the program, if an error occurs, check whether the added path is correct. Note that when precompile prefix header is switched, the PCH compilation and import mechanisms are quite different: (1) if precompile prefix header is yes, PCH will be pre-compiled, the pre-compiled PCH file will be cached to increase the compilation speed. (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.Reference: http://blog.csdn.net/jymn_chen/article/details/39314163
Xcode6 PCH File