- 什么事.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你的工程