无法在 Swift 2.0 中使用类型为 (String, [String]) 的参数列表调用 `join`
Cannot invoke `join` with an argument list of type (String, [String]) in Swift 2.0
var specializationTitles = ["a", "b", "c", "d"]
let outputString = join(" / ", specializationTitles)
遇到错误:
Cannot invoke join
with an argument list of type (String, [String])
如何解决?
let separator = " / "
let outputString = separator.join(specializationTitles)
使用 Xcode7beta6:
specializationTitles.joinWithString(" / ")
Xcode7 发布版本:
specializationTitles.joinWithSeparator(" / ")
在 Swift 2.0 中(Xcode 7 是默认的),你必须使用 joinWithSeparator
specializationTitles.joinWithSeparator(" / ")
var specializationTitles = ["a", "b", "c", "d"]
let outputString = join(" / ", specializationTitles)
遇到错误:
Cannot invoke
join
with an argument list of type(String, [String])
如何解决?
let separator = " / "
let outputString = separator.join(specializationTitles)
使用 Xcode7beta6:
specializationTitles.joinWithString(" / ")
Xcode7 发布版本:
specializationTitles.joinWithSeparator(" / ")
在 Swift 2.0 中(Xcode 7 是默认的),你必须使用 joinWithSeparator
specializationTitles.joinWithSeparator(" / ")