2016-03-04 50 views
0

我正在开发一个应用程序,我想添加一个手机号码/电话号码。为此,我添加了代码,但是在swift 2中,它给出了一个错误,让decimalString =“”.join(components)作为NSString这段代码作为'join'不可用:调用'joinWithSeparator()'方法元素。所以我试图用return jointWithSeparator()替换代码,但这没有帮助。'join'is unavailable:call the'joinWithSeparator()'method on the sequence of elements

回答

0

'join'is unavailable:call the'joinWithSeparator()'method on the sequence of elements。

  • 元件的序列是阵列(components)。
  • 呼吁指定点左侧的表达部分。

在夫特1 join被称为在隔板

"".join(components) 

在夫特2 joinWithSeparator上调用的元素序列

components.joinWithSeparator("") 
相关问题