模拟器与设备的区分宏被标准头文件定义为真假值,所以,其正确的用法为:

#if TARGET_IPHONE_SIMULATOR
NSString * const Mode = @"Simulator";
#else
NSString * const Mode = @"Device";
#endif
//or
#if !TARGET_IPHONE_SIMULATOR
NSString * const Mode = @"Device";
#endif
评论模块尚未加载