【发布时间】:2017-06-24 04:09:02
【问题描述】:
我正在将数据加载到 UITableView 中。
中的前 10 个单元格的第一次加载正确发生func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {}
indexPath.row 正确递增并将数据从数据源加载到正确的单元格中。然后,当到达表格底部时,我执行了更多负载。现在调用了 func tableView 但它卡在 indexPath.row = 9 处。我在
中实现了一个检查器func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
而且似乎添加了正确的行数。
编辑:我的第二个 uitableview 有问题(这个场景中有两个)检查器是一个打印语句,它被调用并返回正确的 uitableView,这发生在 tableView 卡在相同的值之前。
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if tableView == self.table {
return users2.count
}
else {
print("married barry", tableFeedCount)
return tableFeedCount
}
}
【问题讨论】:
-
您的“检查器”代码是什么样的?
标签: ios swift uitableview