2016-03-04 40 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("") 
相關問題