.pch文件預編譯文件

						.pch文件預編譯文件

xcode6 的預編譯文件 沒有了 我們可以自己手動添加
	1.new file -》other-》 創建的xxx.pch
	2.build settings -> Prefix Header  -》添加 xxx.pch在代碼工程中的路徑 
1.相對代碼工程的路徑 PicketKitchen/PicketKitchen.pch
2.或者寫通過 環境變量 獲取當前代碼全路徑$(PROJECT_DIR)/PicketKitchen/PicketKitchen-Prefix.pch
	或者$(SRCROOT)/PicketKitchen/PicketKitchen-Prefix.pch
#ifdef DEBUG
#define NSLog(...) NSLog(__VA_ARGS__)
#else
#define NSLog(...) {}
#endif

//以前 xcode (xcode6之前) 自動 創建一個xxxx.pch預編譯文件,我們可以把一些常用的一些宏定義或者頭文件都在預編譯文件中 寫出來,那麼在其他文件 就可以不用再寫了
//new file——>Other—>PCH模板—》創建一個預編譯文件
預編譯中寫入 

#import <Availability.h>
#ifndef __IPHONE_3_0
#warning "This project uses features only available in iOS SDK 3.0 and later."
#endif
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#endif

然後在Build settings 中 搜索Prefix header



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章