Hey Folks,
All people working on iOS must have come across this file. Lets dive in it for all its pros and cons
What is PCH File?
Positive Face
Negative Face
All people working on iOS must have come across this file. Lets dive in it for all its pros and cons
What is PCH File?
- Pre-Compiled Header File
- Prefix headers are compiled and stored in a cache, and then automatically gets included in every file during compilation & lets you include a file without adding an import statement to it. So rather than parsing the same header files over and over, these files get parsed once, ahead of time.
Naming Convention
- ProjectName-Prefix.pch
Positive Face
- Precompiling the prefix header will be most effective if the contents of the prefix header or any file it includes change rarely.
- They make compiling faster.
Negative Face
- If the contents of the prefix header or any file it includes change frequently, there may be a negative impact to overall build time.
- Avoid adding Macros.
- If you transfer your file to any other project then it may not compile as many dependent headers that were added in PCH are not available @ different location and you need to check the actual one from PCH headers list. This could be a tedious task for Large projects.
- People have one funda >> Adding headers in PCH saves header importing typing time.
Can i compile my project without PCH file
- YES, Ofcourse
How to add PCH file if not provided
Hope you all enjoyed it :)
No comments:
Post a Comment