直接上代碼啦!!!
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
self.title=@"判斷是否是模擬機";
[self isSimulator];
}
#pragma -mark -functions
-(void)isSimulator
{
if (TARGET_IPHONE_SIMULATOR) {
NSLog(@"是模擬機");
}else{
NSLog(@"不是模擬機");
}
}