简体   繁体   English

尝试在Xcode 7 Beta 4中获取系统版本时出现编译错误

[英]Compilation error when trying to get system version in Xcode 7 beta 4

I am getting the following error when i try to get the system version 尝试获取系统版本时出现以下错误

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

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

try this 尝试这个

let theDevice = UIDevice.currentDevice().systemVersion

this will give you 9.0.1 for example for ios 9.01 这将为您提供9.0.1,例如ios 9.01

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Swift代码的Xcode 7 beta 5中的Release中的编译错误 - Compilation error in Release in Xcode 7 beta 5 in Swift code 如何获得较旧的Xcode测试版? - How to get to older Xcode beta version? 尝试打开以前在Xcode 7 Beta中打开的项目时,Xcode 6引发错误 - Xcode 6 throws error when trying to open a project previously opened in Xcode 7 Beta 尝试从 cmake 文件夹生成 Xcode 项目时,我收到与 Xcode 新构建系统相关的错误。 任何可能的解决方案? - When trying to generate an Xcode project from a cmake folder, I get an error related to Xcode new build system. Any possible solution? 尝试使用Xcode11 beta4在iOS13上呈现RPSystemBroadcastPickerView时获取NSInvalidArgumentException - Get NSInvalidArgumentException when trying to present RPSystemBroadcastPickerView on iOS13 with Xcode11 beta4 应用启动时,XCode 9 beta显示错误 - XCode 9 beta showing error when app launch Xcode版本7.1 beta 3启用调试器后无法附加到进程 - Xcode Version 7.1 beta 3 Cannot attach to process when debugger is enabled Xcode 9 beta新版本系统因“无法构建节点”错误而失败 - Xcode 9 beta new build system fails with “unable to build node” error 在Xcode 11 Beta 5中使用ForEach时为什么会出错? - Why do I get error when I use ForEach in Xcode 11 Beta 5? 运行XCode的发行版和Beta版 - Run release and beta version of XCode
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM