天天看点

Xcode6中添加pch

1,Command+N,打开新建文件窗口:ios->other->PCH file,创建一个pch文件:“工程名-Prefix.pch”:

Xcode6中添加pch

2,将building setting中的precompile header选项的路径添加“$(SRCROOT)/项目名称/pch文件名”(例如:$(SRCROOT)/LotteryFive/LotteryFive-Prefix.pch)

Xcode6中添加pch

可以了,编译一下程序,如果有错误检查一下添加的路径是否正确。

3,将Precompile Prefix Header为YES,预编译后的pch文件会被缓存起来,可以提高编译速度

Xcode6中添加pch

转载于:https://www.cnblogs.com/iamjjh/p/4563573.html