关于Xcode6预编译文件
source link: http://quangelab.com/xcode6-ProjectName-Prefix/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
关于Xcode6预编译文件
##Xcode6去掉预编译文件的原因
从Xcode6开始新建一个项目xcode不再自动创建预编译文件PrefixHeader.pch,主要原因可能在于Prefix Header大大的增加了Build的时间。没有了Prefix Header之后就要通过手动@import来手动导入头文件了,在失去了编程便利性的同时也降低了Build的时间。可以参考stackoverflow上的讨论。
##Xcode6如何创建预编译文件
1、添加新文件
2、去Project/Build Setting/APPl LLVM 6.0-Language
设置
##会有哪些问题
在我的项目LoveiOS中用到了c语言写的第三方库sundown,添加了预编译文件编译的时候报了N多”NSObjCRuntime.h”错误,后来发现了原因 开始我是这个写的
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#endif
#import "RVMViewModel.h"
#import "ReactiveCocoa.h"
#import "UALogger.h"
#import "AFNetworking.h"
#import "Mantle.h"
#import "MBProgressHUD.h"
后来改成了
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#import "RVMViewModel.h"
#import "ReactiveCocoa.h"
#import "UALogger.h"
#import "AFNetworking.h"
#import "Mantle.h"
#import "MBProgressHUD.h"
#endif
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK