【发布时间】:2018-11-01 23:05:50
【问题描述】:
我有一个 UITableView 和一个 countries 变量,其签名如下:
let countryArray = ["Bangladesh", "India", "Pakistan", "Nepal", "Bhutan", "China", "Malaysia", "Myanmar", "Sri Lanka", "Saudi Arabia"]
当我尝试在 UITableView 中绑定这些国家/地区时,它显示错误 Generic parameter 'Self' could not be inferred。
这是我正在做的 sn-p:
let countries = Observable.just(countryArray)
countries.bindTo(self.tableView.rx.items(cellIdentifier: "myCell",
cellType: MyCell.self)) {
row, country, cell in
// configuring cell
}
.addDisposableTo(disposeBag)
【问题讨论】:
标签: ios swift generics rx-swift