1.区分系统是否为IOS6.0
#ifdef __IPHONE_6_0
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
NSLog(@"-------------");
return UIInterfaceOrientationMaskPortrait;
}
#endif
2.区分系统版本
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_3_2
//ToDo...
#endif
3.区分模拟器编译和真机编译
#if TARGET_IPHONE_SIMULATOR
NSLog(@"iphoneSimulator");
#elif TARGET_OS_IPHONE
NSLog(@"iphoneDevice");
#endif
4.判断设备类型:http://blog.csdn.net/qianhen136/article/details/7534571
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
NSLog(@"iPad");
}
else if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
{
NSLog(@"iPhone or iTouch");
}