Today I write a project to use global variables, the first reaction to think of the PCH file this thing.
PCH file is a standard precompiled header file (precompiled header). After Xcode6, if we are going to use a PCH file, we have to manually create it ourselves.
I'm going to record the process of creating a PCH file myself, and I need to see it!
First we have to manually create the PCH file.
1. Create a new file in the project's supporting files or other project locations
2. Select PCH File creation
3. Modify the file name (modify it at your own discretion)
4. Write what you need to set global variables in the PCH file
5. Configure the path
$ (srcroot) Auto Get path
Chat about your project name
prefixheader.pch the PCT file name you created
When the precompile Prefix header is yes, the PCH will be precompiled and the precompiled PCH file will be cached to improve the compilation speed. When the precompile Prefix header is no, the PCH is not precompiled, but is compiled once in each. m file that uses the Framework class library that it imports.
Note: In the PCH file, try not to introduce the header file, although this is very convenient, but the compilation speed will become very slow. The introduction of header files can be specifically built with a. h file for the header.
In the next time I will not regularly update some of the good way to their own book, Thank you, and communicate with each other!
Text/light Drunk 17 (Jane book author)
Original link: http://www.jianshu.com/p/82dcb438f8aa
Copyright belongs to the author, please contact the author to obtain authorization, and Mark "book author".
Application of PCH files in iOS