.pch文件,扩展名.pch表示"precompiled header"。Xcode将编译这些头到文件,这将减少你在选择Build 或Build and Go时编译项目的时间。最近才发现用Xcode6建的工程相比之前的Xcode版本已经没有了这个文件。至于为什么Xcode会没有了这个文件见:Why isn't ProjectName-Prefix.pch created automatically in Xcode 6?
1.在工程中添加文件,选择iOS/Other-PCH File

2.命名,创建

3.最重要的一部,在Project/Build Settings/Apple LLVM 6.0 Language/Prefix Header 添加路径,最简单的办法就是把.pch文件拖拽过去就会自动生成路径,手动填写路径很麻烦。

4.编译即可通过。
参考:http://www.tuicool.com/articles/beURbe
网友评论