月曜日, 1月 19, 2009

iPhone と iPhone Simulator を判別する方法

http://d.hatena.ne.jp/iphone_dev/20080925/1222336515


#import <TargetConditionals.h>


#if (TARGET_IPHONE_SIMULATOR)


   // シミュレータで動作している場合のコード


NSLog(@"Running on Simulator");


#else


   // 実機で動作している場合のコード


NSLog(@"Running on Device");


#endif



0 件のコメント: