.pch File in Xcode 6.1

天大地大妈咪最大 提交于 2019-12-23 02:13:51

问题


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


回答1:


  1. You'll need to create a PCH file named ProjectName-Prefix.pch. In the new file dialog you'll find PCH under Other.
  2. 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'
  3. Now add any headers you want globally included in your PCH file
  4. Clean and rebuild your project.


来源:https://stackoverflow.com/questions/29305205/pch-file-in-xcode-6-1

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!