我希望在Objective-C类中有一个编译器(预编译器)指令来区分模拟器构建和设备构建.
#if SIMULATOR call testModule(); #else call productionModule(); #endif
iPad / iPhone的X代码中是否有#directive?
解决方法
#if TARGET_IPHONE_SIMULATOR // simulator code #else //device code #endif