I've tried
#ifdef TARGET_IPHONE_SIMULATOR
static BOOL isSimulator = YES;
#endif
But for both device and simulator, the isSimulator variable always comes out to 1.
I need a way to figure out if the code running is on iOS simulator or on a device.