2

I created a new project using Xcode 6.3.1 and I want to manual add a 'pch' file to my project. I was looking at questions online PCH File in Xcode 6 but the selected answer says to go to LLVM6.0 but that does not exist in build settings anymore. Where can i find it to add the .pch?

Community
  • 1
  • 1
DevC
  • 6,982
  • 9
  • 45
  • 80

2 Answers2

5

To create a prefix header (pch) file you'll have to do the following:

  1. Go to (or use ⌘cmd+N) File > New > File > Other (in iOS or OSX).
  2. Select PCH File.
  3. Give it a name and store it somewhere in your project.
  4. Go to your project's target > Build Settings.
  5. Search for prefix header.
  6. Under Apple LLVM 6.1 - Language you will find the Prefix Header key.
  7. Add the path to your pch file like so: $(PROJECT_NAME)/myPrefixHeaderFile.pch.
  8. Clean your project (⌘cmd+⇧shift+K) and build (⌘cmd+B).

Below is a screenshot showing where to find it in Build Settings: Prefix Header (PCH) File

Razvan
  • 4,122
  • 2
  • 26
  • 44
1

Search for prefix header - Under Apple LLVM 6.1 - Language Set Precompile Prefix Header to Yes and then set Path of your .pch file in Prefix Header

https://i.stack.imgur.com/S0wdk.png