PCH File in Xcode 6
Xcode6PchXcode6 Problem Overview
In my previous projects, I can find the .pch
file under Supporting Files.
But now in Xcode 6, I couldn't find any .pch
file. Any steps should I do to produce this file?
Xcode6 Solutions
Solution 1 - Xcode6
- Make new file: ⌘cmd+N
- iOS/Mac > Other > PCH File > YourProject-Prefix.pch.
- Make sure you display "All" and not "Basic". (Blue buttons)
- Project > Build Settings > Search: "Prefix Header".
- Under "Apple LLVM 7.0" you will get the Prefix Header key.
- Type file directory. e.g: "$(SRCROOT)/$(PROJECT_NAME)/ProjectName-Prefix.pch".
- Clean project: ⌘cmd+⇧shift+K
- Build project: ⌘cmd+B
Solution 2 - Xcode6
Add the pch file which is under Others in File-New...and don't forget to add it to your LLVM6.0 - Language section of Build Settings as Project/whateveryounamedyourpchfile.pch
Solution 3 - Xcode6
Rob Napier's answer at https://stackoverflow.com/questions/24158648/why-isnt-projectname-prefix-pch-created-automatically-in-xcode-6 is worth reading. He points out that a PCH file is probably not a good idea, and suggests explicitly including .h files into modules that need them.
Solution 4 - Xcode6
I've found out that with Xcode 6. You need to manually create the PCH File.
File -> New -> File -> iOS -> C and C++ -> PCH File.
Solution 5 - Xcode6
There is a minor error in the answer provided above.Please note that in the build setting under prefix.header you just need to type your .pch file name –
Solution 6 - Xcode6
In my case issue was getting
I fixed by Removing .pch file from project and adding again this work for me.hope this help someone.