Target iPhone Simulator Macro Not Working

TARGET_OS_SIMULATOR is defined on the device (but defined to false). The fix is:

#include <TargetConditionals.h> // required in Xcode 8+

#if TARGET_OS_SIMULATOR
NSString * const Mode = @"Simulator";
#else
NSString * const Mode = @"Device";
#endif

Not sure when this was changed. I’m fairly sure it was possible to use ‘ifdef’ in the past.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)