我希望在 Objective-C 类中有一个编译器(预编译器)指令来区分模拟器构建和设备构建。
#if SIMULATOR call testModule(); #else call productionModule(); #endif
iPad/iPhone 的 X 代码中有这样的 #directive 吗?
最佳答案
#if TARGET_IPHONE_SIMULATOR
// simulator code
#else
//device code
#endif
关于iphone - iPad:我可以使用编译器指令来区分模拟器和设备吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3453615/