2010-01-16
VisualStudioC++におけるstdafx.hと同じ働きをするものを、XCodeでも使えるようにする
プロジェクト内のOther Sources以下に、stdafx.hを保存する。
同じフォルダに「(プロジェクト名)_Prefix.pch」というファイルがあるので、下のようにstdafx.hを読み込むように設定する。
// // Prefix header for all source files of the 'AVG Engine' target in the 'AVG Engine' project // #ifdef __OBJC__ #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> // すべてのソースで参照されるヘッダファイル #import "stdafx.h" #endif
これで、VisualStudio C++に慣れてる人でも違和感なく使えるかも。
コメントを書く