ios sdk 判断系统版本

  1. float version = [[[UIDevice currentDevice] systemVersion] floatValue];  
  2. if (version >= 3.0)  
  3.  {  
  4.     // iPhone 3.0 code here  
  5.  }  

 

用宏指令判断系统版本

  1. #ifdef __IPHONE_3_0  
  2. - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation duration:(NSTimeInterval)duration {  
  3. #else  
  4. - (void)willAnimateSecondHalfOfRotationFromInterfaceOrientation: (UIInterfaceOrientation)fromInterfaceOrientation duration:(NSTimeInterval)duration {  
  5. #endif  
  6. }  
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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值