What is the Prefix.pch file?
.Pch is a precompiled header.
In the C and C ++ programming languages, the header file is a file whose text can be automatically included by the C preprocessor in another source file, usually determined using the compiler directives in the source file.
Prefix headers are compiled and cached, and then automatically included in each file at compile time. This can speed up compilation and allow you to include the file without adding an import statement to every file that uses it. They are optional, and in fact slow compilation whenever you change them.
Yes, you can compile and run the project without a .pch file
In Xcode, go to your target build settings (Command-Option-E, build tab) and uncheck Precompile Prefix Header (GCC_PRECOMPILE_PREFIX_HEADER). You can also remove the prefix header parameter value if you wish.
Also note that
Do not put macros in a .pch file! A .pch file is, by definition, a precompiled project-specific header. It really should not be used outside the context of the project, and it should not contain anything other than #include and #imports.
If you have some macros and ones that you want to split between the headers, paste them into your own header file - Common.h or any other - and #include that at the beginning of .pch
Hemang May 14 '14 at 7:56 a.m. 2014-05-14 07:56
source share