Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "TargetConditionals.h"
- #ifdef __APPLE__
- #include "TargetConditionals.h"
- #endif
- #if !(TARGET_IPHONE_SIMULATOR)
- #ifdef __i386__
- NSLog(@"Running in the simulator");
- #else
- NSLog(@"Running on a device");
- #endif
- #if TARGET_IPHONE_SIMULATOR
- NSString *hello = @”Hello, iPhone simulator!”;
- #elif TARGET_OS_IPHONE
- NSString *hello = @”Hello, device!”;
- #else
- NSString *hello = @”Hello, unknown target!”;
- #endif
- NSString *model = [[UIDevice currentDevice] model];
- if ([model isEqualToString:@"iPhone Simulator"]) {
- //device is simulator
- }
- #if TARGET_IPHONE_SIMULATOR
- #ifdef TARGET_IPHONE_SIMULATOR
- #if defined __arm__ || defined __thumb__
- #undef TARGET_IPHONE_SIMULATOR
- #define TARGET_OS_IPHONE
- #else
- #define TARGET_IPHONE_SIMULATOR 1
- #undef TARGET_OS_IPHONE
- #endif
Add Comment
Please, Sign In to add comment