【问题标题】:Determine Version of iOS [duplicate]确定iOS版本[重复]
【发布时间】:2012-06-07 15:55:27
【问题描述】:

可能重复:
Check iPhone iOS Version

我正在尝试在 iOS 5.0.1 上设置一些与 iOS 5.1 及更高版本不同的代码。有没有判断的if语句?

【问题讨论】:

标签: iphone ios xcode


【解决方案1】:
float version = [[[UIDevice currentDevice] systemVersion] floatValue];

【讨论】:

    【解决方案2】:
       if ( [[[UIDevice currentDevice] systemVersion] floatValue] == 5.0)
    {
    // Do something
    }
    
    
    else if ( [[[UIDevice currentDevice] systemVersion] floatValue] == 5.1)
    {
    // Do something
    }
    else
    {
    // Do something
    }
    

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-04-22
    • 1970-01-01
    • 2018-04-16
    • 2019-10-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多