问题描述
这个问题涉及将一个头文件添加到xcode 6.1项目中。我想要做的是添加一个头文件,该文件会自动导入到我创建的每个文件中。
即
我创建了啊& am
其中包含了PriorMade.pch或previouslyMade.h定义。
设置,并且没有更新.pch文件的选项。
是否有解决方案或者我每次创建时都需要导入.h文件一个新的文件?
谢谢
- 您需要创建一个名为
ProjectName-Prefix.pch
的PCH文件。在新文件对话框中,您会在其他位置找到PCH。 - 转到
项目>构建设置
并搜索Prefix Header。在Apple LLVM 6.0 - 语言下添加您的PCH文件:ProjectName / ProjectName-Prefix.pch
注意:确保选择'All'而不是'Basic' - 现在添加您希望在您的PCH文件中全部包含的任何标题
- 清理并重建您的项目。
I have looked all over and cannot find a solution to this problem.
The problem involves adding a header file to an xcode 6.1 project. What I want to be able to do is add a header file that is automatically imported to each of the files I create.
i.e.
I create a.h & a.m.
Where previouslyMade.pch or previouslyMade.h definitions are already included.
I've looked through build settings and there isn't an option to update the .pch file.
Is there a solution to this or have I got to import a .h file every time I make a new file?
Thanks
- You'll need to create a PCH file named
ProjectName-Prefix.pch
. In the new file dialog you'll find PCH under Other. - Go to
Project > Build Settings
and search "Prefix Header". Under "Apple LLVM 6.0 - Language" add your PCH file:ProjectName/ProjectName-Prefix.pch
note: make sure you select 'All' not 'Basic' - Now add any headers you want globally included in your PCH file
- Clean and rebuild your project.
这篇关于.px文件在Xcode 6.1中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!