2016-09-20 37 views
0

我在SOAP服務中有一個查詢,它返回一個DataSource,DataSource每行有兩列,如何使用Swift 2.3將這些列帶到UIPickerView中?如何將NSMutableArray傳遞給UIPickerView?

enter image description here

我使用此代碼來傳遞數據源:

func pickerView(pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? { 

      print(DataSource[row]) 

    if component == 0 { 

      return DataSource[row][IdPessoa] as? String 
    } else { 

      return DataSource[row][Empresa] as? String 
    } 
} 
+0

你是怎麼做到的? – Adarkas2302

回答

0

好了,我不知道什麼問題,你所面臨的。但你可以編輯該行:

DataSource [row] [「IdPessoa」] as?字符串

同樣,編輯其他部分的行。

否則方法是正確的。確保設置了數據源和委託。

相關問題