【发布时间】:2017-09-28 04:22:00
【问题描述】:
我在选项卡控制器中有 3 个表视图,所有这些视图都像这样填充:
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.dataSource = self.notesTableView.bind(to: getQuery()) { tableView, indexPath, snap in
let cell = self.notesTableView.dequeueReusableCell(withIdentifier: "cellident", for: indexPath)
let customCell = cell as! TextCell
self.notesTableView.dataSource = self.dataSource
self.notesTableView.delegate = self
if let note = snap.childSnapshot(forPath: "note").value as! String? {
customCell.notesLabel.text = note
} else {
customCell.notesLabel.text = "Undefined"
}
return cell
}
}
当我在手机上运行应用程序并在选项卡之间切换时,在某些时候我总是遇到这个异常:
'NSInternalInconsistencyException',原因:'无效更新:第 0 节中的行数无效。
此外,控制台显示了这一点,但我不确定如何解释:
*** -[UITableView _endCellAnimationsWithContext:] 中的断言失败,/BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit/UIKit-3600.7.47/UITableView.m:1737
我的问题是,如果有人知道这个与 FirebaseUI 相关的异常的原因可能是什么。我的猜测是它与填充表格有关。
【问题讨论】:
-
你的
tableView(_:numberOfRowsInSection:)方法的内容是什么样的? -
@ToddKerpelman 我没有那种方法。我认为这应该包含在 FirebaseUI 库中。
标签: ios swift firebase firebase-realtime-database firebaseui