gpt4 book ai didi

ios - FirebaseUi - 将 UITableViewCell 的值快速转换为自定义类

转载 作者:行者123 更新时间:2023-11-30 13:42:16 25 4
gpt4 key购买 nike

我似乎无法在 firebaseUI 上获取原型(prototype)重用标识符。如果我添加一个prototypecell,我只能给它一个cellidentifier

在我的以下代码中,链接到自定义单元格的 IBoutlets 返回 nil。

这是我的代码:

func loadData() {


self.dataSource = FirebaseTableViewDataSource(ref: refpost, cellClass: MainWitnessTableViewCell.self, cellReuseIdentifier: "<RIcell>", view: self.tableView)


self.dataSource.populateCellWithBlock { (cell: UITableViewCell, obj: NSObject) -> Void in

let snap = obj as! FDataSnapshot
print(cell)

let mycell = cell as! MainWitnessTableViewCell

let keyy: String = (snap.value.objectForKey("author") as? String)!


mycell.postContent.text = keyy
print (mycell.postContent.text)

}

self.tableView.dataSource = self.dataSource
}

这里,mycell.postContent.text 返回 nil,是否有任何巫术一直让我失明? :)真挚地严恩

最佳答案

我觉得你应该改变

cellReuseIdentifier: "<RIcell>"

cellReuseIdentifier: "RIcell"

关于ios - FirebaseUi - 将 UITableViewCell 的值快速转换为自定义类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35418202/

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