Possible Duplicate:
How can I programmatically determine if my app is running in the iphone simulator?
How I can check in XCode 4 with constant if my program is running in simulator o device? Something like this:
#ifdef RUNING_ON_DEVICE
#else
#endif
Possible Duplicate:
How can I programmatically determine if my app is running in the iphone simulator?
How I can check in XCode 4 with constant if my program is running in simulator o device? Something like this:
#ifdef RUNING_ON_DEVICE
#else
#endif
There are a couple of options
Preprocessor macro:
#if TARGET_IPHONE_SIMULATOR
//is sim
#elif TARGET_OS_IPHONE
//is real device
#else
//unknown target
#endif
Or, if you'd rather do it in some arbitrary method:
if ([[[UIDevice currentDevice] model] isEqualToString:@"iPhone Simulator"]) {
    //device is simulator
}
