Using .pch file to include applcation files

2 Solutions Collect From Internet About “Using .pch file to include applcation files”

“Hi Alex .. I’ll take bad ideas for $1000” 😀

Aside from Oscar’s answer, you will also subvert the build process. As every file knows about and hence depends on every other file, then changing a single file will mean that all compilation units in the project will be forced to be built on every recompilation – rather than just building what has changed.

It is definitely not a good practice, you should however definitely include the files that will be needed in all or most of the files, singletons and data models would be a good candidate for example.

The reason why this is a bad idea is cycling references, if you were to include all your files in that .pch file you will soon get some errors about cycling references.