0

我在 SOAP 服务中有一个查询,它返回一个 DataSource,DataSource 每行有两列,如何使用 Swift 2.3 将这些列带入 UIPickerView?

在此处输入图像描述

我正在使用此代码来传递数据源:

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
    }
}
4

1 回答 1

0

嗯,我不知道你面临的问题是什么。但是您可以编辑该行:

DataSource[row]["IdPessoa"] as? 细绳

同样,在其他部分编辑该行。

否则方法是正确的。确保设置了数据源和委托。

于 2016-12-06T09:52:04.347 回答