tags:

views:

39

answers:

1

I want to have a compiler (pre-compiler) directive in my objective-C class to distinguish between the simulator build and the device build.

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

Is there such a #directive in X-code for the iPad/iPhone?

+5  A: 
#if TARGET_IPHONE_SIMULATOR
// simulator code
#else
//device code
#endif
Vladimir