Cannot invoke 'split' with an argument List of type '(String,(_) -> _,maxSplit: Int,allowEmptySlices: Bool)'概述在 Swift 1.2的最新升级之后,我无法弄清楚如何将一行文字分割成单词.我曾经这样做: let bits = split(value!, { $0 == " "}, maxSplit: Int.max, allowEmptySlices: false) 但是,这不再工作,因为… Cannot invoke 'split' with an argument list of type '(Stri 在 Swift 1.2的最新升级之后,我无法弄清楚如何将一行文字分割成单词.我曾经这样做:let bits = split(value!,{
== " "},maxSplit: Int.max,allowEmptySlices: false)
但是,这不再工作,因为…Missing argument for parameter 'isSeparator' in calllet bits = split(value!,{
== " "})
嗯,好的,尽管我可以继续建设?好吧,我们试试看吧== " "})== " " }let bits = split(value!,allowEmptySlices: false,isSeparator: {let bits = split(value!) { == " " }let bits = split(value!,isSeparator: {let bits = split(value!,allowEmptySlices: false) {
== " "})
那么我可以想到的每个其他版本都会说:
让我们听听Beta版测试新的编程语言!好极了!
任何人知道正确的秘密酱1.2?
Swift 1.2中的参数似乎有所改变:或使用默认值:
参数名称isSeparator,因为它的前面是可选参数.
句法:
要么 总结 以上是内存溢出为你收集整理的迅速 – 分裂现在抱怨失踪
“isSeparator”全部内容,希望文章能够帮你解决迅速 – 分裂现在抱怨失踪“isSeparator”所遇到的程序开发问题。
评论列表(0条)