gpt4 book ai didi

swift - RxSwift : Ambiguous reference to member 'items(cellIdentifier:cellType:)'

转载 作者:行者123 更新时间:2023-11-30 12:11:57 28 4
gpt4 key购买 nike

我尝试使用 RxSwift (3.6.1) 设置 tableView 数据源绑定(bind),但在构建应用程序时遇到错误:

Ambiguous reference to member 'items(cellIdentifier:cellType:)'

这里只是来自数组的简单 Observable 仅用于测试:

Here just simple <code>Observable</code> from <code>Array<Int></code> just for test

附注viewController的tableView在Storyboard中连接

最佳答案

您错过了 ){ 之间的一点 )!

正确的代码应该是:

    let test = Observable.just([1, 2, 3, 4, 5]).bind(to: tableView.rx.items(cellIdentifier: "pokatushkaCell")) {
// ^
row, item, cell in
}

注意箭头所指的位置。您错过了 ),使 Swift 认为您想要使用两个参数调用 items

关于swift - RxSwift : Ambiguous reference to member 'items(cellIdentifier:cellType:)' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45943626/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com