使用TARGET_IPHONE_SIMULATOR和TARGET
2020-06-17 本文已影响0人
Peter杰
#if TARGET_IPHONE_SIMULATOR
NSLog(@"run on simulator");
#else
NSLog(@"run on device");
#endif
#if TARGET_IPHONE_SIMULATOR
NSLog(@"run on simulator");
#else
NSLog(@"run on device");
#endif