美文网首页
如何添加.pch or prefix.pch 文件到xcode

如何添加.pch or prefix.pch 文件到xcode

作者: 冰J冰 | 来源:发表于2016-01-29 09:50 被阅读128次
  • 什么事.pch文件?

File > New > File > iOS > Other > PCH File

Paste_Image.png

*设置pch 文件名为: projectName-Prefix.pch

*设置pch 文件内容

//
// Prefix header
//
// The contents of this file are implicitly
// included at the beginning of every source file
//

#import <Availability.h>

#ifndef __IPHONE_5_0
#warning "This project uses features only available in iOS SDK 5.0 and later."
#endif

#ifdef __OBJC__
   #import <UIKit/UIKit.h>
   #import <Foundation/Foundation.h>
#endif
  • Project > Build Settings > Search for “Prefix Header
Paste_Image.png

6.) 输入:$(SRCROOT)/YourProject-Prefix.pch
7.) Clean 并且 build你的工程

相关文章

网友评论

      本文标题:如何添加.pch or prefix.pch 文件到xcode

      本文链接:https://www.haomeiwen.com/subject/kqyjkttx.html