Xcode 6.1 Precompiled Headers

2019-04-06 19:32发布

In Xcode 6.1, creating a new project does not create a precompiled header file using the single view iOS project template. If I add one manually, any definitions in the pch file are not available in any other source files.

I've looked at many threads and questions and tried cleaning, re-buiding, re-starting, deleting derived data and manually removing the CACHE_ROOT/SharedPrecompileHeaders folder. All to no avail, though.

Some info suggests ticking to include in targets, but this is disabled for pch and other header files now.

See comment below.

标签: xcode6
1条回答
戒情不戒烟
2楼-- · 2019-04-06 19:57

Have you tried adding the path of the pch file?

Go to your project -> Build Settings -> Apple LLVM 6.0 Language.

Under it, set the following things:

  • Precompile Prefix Header: Set it to YES
  • Prefix Header: Set the path to the pch file

Update 2018/09/23: In Xcode10 it is under Apple Clang - Language

enter image description here

查看更多
登录 后发表回答