- float version = [[[UIDevice currentDevice] systemVersion] floatValue];
- if (version >= 3.0)
- {
- // iPhone 3.0 code here
- }
用宏指令判断系统版本
- #ifdef __IPHONE_3_0
- - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation duration:(NSTimeInterval)duration {
- #else
- - (void)willAnimateSecondHalfOfRotationFromInterfaceOrientation: (UIInterfaceOrientation)fromInterfaceOrientation duration:(NSTimeInterval)duration {
- #endif
- }
ios sdk 判断系统版本
float version = [[[UIDevice currentDevice] systemVersion] floatValue];
if (version >= 3.0)
{
// iPhone 3.0 code here
}
用宏指令判断系统版本
#ifdef __IPHONE_3_0
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation duration:(NSTimeInterval)duration {
#else
- (void)willAnimateSecondHalfOfRotationFromInterfaceOrientation: (UIInterfaceOrientation)fromInterfaceOrientation duration:(NSTimeInterval)duration {
#endif
}
崔银江 09:34:18
判断系统版本(用宏,非UIDevice)以及是否为iPad (2012-03-21 12:51:46)转载▼
标签: 宏 ios 判断 版本 it 分类: iOS
static BOOL FBIsDeviceIPad() {
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 30200
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
return YES;
}
#endif
return NO;
}
// To be compatible with OS 2.x
#if __IPHONE_OS_VERSION_MAX_ALLOWED <= __IPHONE_2_2
_closeButton.font = [UIFont boldSystemFontOfSize:12];
#else
_closeButton.titleLabel.font = [UIFont boldSystemFontOfSize:12];
#endif
float version = [[[UIDevice currentDevice] systemVersion] floatValue];
if (version >= 3.0)
{
// iPhone 3.0 code here
}
用宏指令判断系统版本
#ifdef __IPHONE_3_0
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation duration:(NSTimeInterval)duration {
#else
- (void)willAnimateSecondHalfOfRotationFromInterfaceOrientation: (UIInterfaceOrientation)fromInterfaceOrientation duration:(NSTimeInterval)duration {
#endif
}
崔银江 09:34:18
判断系统版本(用宏,非UIDevice)以及是否为iPad (2012-03-21 12:51:46)转载▼
标签: 宏 ios 判断 版本 it 分类: iOS
static BOOL FBIsDeviceIPad() {
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 30200
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
return YES;
}
#endif
return NO;
}
// To be compatible with OS 2.x
#if __IPHONE_OS_VERSION_MAX_ALLOWED <= __IPHONE_2_2
_closeButton.font = [UIFont boldSystemFontOfSize:12];
#else
_closeButton.titleLabel.font = [UIFont boldSystemFontOfSize:12];
#endif