ios - Xcode 7.0 beta 4 未检测到 swift 2.0

标签 ios xcode swift2

我已经安装了 Xcode 7.0 beta 4 但是,我认为 Xcode 能够在我的代码中检测到 swift 2.0 函数

    let array = ["1", "2", "3"]
    let stringRepresentation = array.joinWithSeparator("-")
    print(stringRepresentation)

Xcode 显示错误“‘[String]’没有名为‘joinWithSeparator’的成员”,如下图所示

enter image description here

此外,当我在终端中运行“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/

相关文章:

ios - Swift 从核心数据获取图像到 TableView

ios - 为什么不能删除本地xib?请看截图。

swift - 在 Swift 中使用 where 子句扩展数组类型

ios - 无法从 UISegmentedControl 重新加载表数据

ios - 以编程方式从 UINavigationBar 隐藏 UIBarButtonItem Swift2

ios - UICollectionView - 下载图像和有效地重新加载数据,如 Instagram

ios - 如何从 LaunchScreen 过渡到 Swift 中的主页?

ios - 我的应用程序崩溃了,并显示该类不符合使用swift编写的key tableView的键值编码

ios - 使用 UIView Animation 在 Xcode 中制作动画时,按钮不执行被点击的操作

objective-c - IOS UITableViewCell Spacer(或边距)