iPad:编译器指令我可以用来区分模拟器和设备?

时间:2010-08-10 21:32:03

标签: iphone xcode ipad

我想在Objective-C类中使用编译器(预编译器)指令来区分模拟器构建和设备构建。

#if SIMULATOR
call testModule();
#else
call productionModule();
#endif

iPad / iPhone的X代码中是否有#directive?

1 个答案:

答案 0 :(得分:10)

#if TARGET_IPHONE_SIMULATOR
// simulator code
#else
//device code
#endif
相关问题