pch

1.プロジェクトに、PCHファイルを新規して添登録する。
ヘッダー(.h)として新規登録し、拡張子は、(.pch)に変更する。
例)(ProjectName) + -(ハイフン) + (Prefix.pch)

2.ターゲントの設定を変更する。詳細は下記の通り。
例)Xcode9 の場合
Target -> Build Settings -> Apple LLVM 9.0 - Language
Prefix Header を $(SRCROOT)/FILENAME.pch とする。


例)pchファイルフォーマット

----ここから----


#import <Availability.h>

/*
*  バージョンチェック
*/
#ifndef __IPHONE_4_0
#warning "This project uses features only available in iOS SDK 4.0 and later."
#endif

/*
*  共通ヘッダー
*/
#ifdef __OBJC__

//
// ここに共通ヘッダーを追加していく
//





#endif

/*
*  ログ出力定義変更(リリース時にログ出力しないように)
*/
//
#ifdef NS_BLOCK_ASSERTIONS

#ifndef NSLog
#define NSLog( m, args... )
#endif

#else

#ifndef NSLog
#define NSLog( m, args... ) NSLog( m, ##args )
#endif

#endif


----ここまで----
最終更新:2018年02月21日 11:08