【问题标题】:Compilation error when trying to get system version in Xcode 7 beta 4尝试在 Xcode 7 beta 4 中获取系统版本时出现编译错误
【发布时间】:2015-08-26 10:57:10
【问题描述】:

当我尝试获取系统版本时出现以下错误

 //let Device = UIDevice.currentDevice() //this line also cause a compilation error
 let iosVersion = NSString(string: Device.systemVersion).doubleValue

命令 /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc 失败,退出代码为 1

【问题讨论】:

  • 您是如何发现错误与该命令相关的?

标签: xcode swift2 ios9


【解决方案1】:

试试这个

let theDevice = UIDevice.currentDevice().systemVersion

这将为您提供 9.0.1,例如 ios 9.01

【讨论】:

    猜你喜欢
    • 2015-10-30
    • 1970-01-01
    • 1970-01-01
    • 2011-11-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-03-04
    • 1970-01-01
    相关资源
    最近更新 更多