我已经安装了 Xcode 7.0 beta 4 但是,我认为 Xcode 能够在我的代码中检测到 swift 2.0 函数
let array = ["1", "2", "3"]
let stringRepresentation = array.joinWithSeparator("-")
print(stringRepresentation)
Xcode 显示错误“‘[String]’没有名为‘joinWithSeparator’的成员”,如下图所示
此外,当我在终端中运行“xcrun swift”时,它会显示
Welcome to Apple Swift version 2.0 (700.0.47.1 700.0.59.1). Type :help for assistance.
1>
我在这里被难住了,无法运行 swift 2.0 代码。
最佳答案
joinWithSeparator
出现在 Xcode beta 6 中。
关于ios - Xcode 7.0 beta 4 未检测到 swift 2.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32522096/