在Xcode6之前,系统自动带有-Prefix.pch文件 我们可以在其中导入一些在项目其他类中经常需要导入的文件,Xcode6之后,系统没有自动生成-Prefix.pch文件这一说法了,所以,需要我们自己创建
我们如何在Xcode6中添加pch(Precompile Prefix Header)?
1,打开新建文件窗口:ios->other->PCH file,创建一个pch文件:“工程名-Prefix.pch”:
2.然后在building setting中搜索pref 找到prefix header 选项的路径添加“$(SRCROOT)/项目名称/pch文件名”(例如:$(SRCROOT)/JustTest/JustTest-Prefix.pch)
可以了,编译一下程序,如果有错误检查一下添加的路径是否正确。
@ 取消的原因:<喎�"http://www.2cto.com/kf/ware/vc/" target="_blank" class="keylink">vcD48cD4gICAgICBTdGFja292ZXJmbG93yc/T0NK7uPbIy7bUtMu1xL3iys3Kx9Xi0fm1xKO6PGJyIC8+ICAgICAgIEkgc3VzcGVjdCBiZWNhdXNlIG9mIG1vZHVsZXMsIHdoaWNoIHJlbW92ZSB0aGUgbmVlZCBmb3IgdGhlIDxjb2RlPiAjaW1wb3J0IDxDb2NvYS9Db2NvYS5oPi48L2NvZGU+PGJyIC8+ICAgICAgIEFzIHRvIHdoZXJlIHRvIHB1dCBjb2RlIHRoYXQgeW91IHdvdWxkIHB1dCBpbiBhIHByZWZpeCBoZWFkZXIsIHRoZXJlIGlzIG5vIGNvZGUgeW91IHNob3VsZCBwdXQgaW4gYSBwcmVmaXggaGVhZGVyLiBQdXQgeW91ciBpbXBvcnRzIGludG8gdGhlIGZpbGVzIHRoYXQgbmVlZCB0aGVtLiBQdXQgeW91ciBkZWZpbml0aW9ucyBpbnRvIHRoZWlyIG93biBmaWxlcy4gUHV0IHlvdXIgbWFjcm9zLi4ubm93aGVyZS4gU3RvcCB3cml0aW5nIG1hY3JvcyB1bmxlc3MgdGhlcmUgaXMgbm8gb3RoZXIgd2F5IChzdWNoIGFzIHdoZW4geW91IG5lZWQgX19GSUxFX18pLiBJZiB5b3UgZG8gbmVlZCBtYWNyb3MsIHB1dCB0aGVtIGluIGEgaGVhZGVyI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