iOS Simulator detection
When working with iOS features that are only available on the devices and not in the Simulator, it can be helpful for testing to pop an alert or provide ‘stub’ data.
Fortunately there are some definitions provided by Apple to help identify what the code is targeted for.
#if TARGET_IPHONE_SIMULATOR
// Code for simulator.
#else
// Code for device
#endif
Reference: wiki