我在某些情况下通过以下方式更新表格视图单元格:
tableView.moveRow(at: indexPath, to: IndexPath(row: 0, section: 1))
Run Code Online (Sandbox Code Playgroud)
我在 firebase crashlytics 上遇到崩溃,如下所示:
UITableView internal inconsistency: encountered out of bounds global row index while preparing batch updates (oldRow=1, oldGlobalRowCount=1)
Run Code Online (Sandbox Code Playgroud)
如果有人知道可能是什么情况,谢谢
小智 0
您的表格视图datasource在尝试重绘之前似乎没有更新。尝试将代码放在beginUpdated和之间endUpdates
tableView.beginUpdates()
tableView.moveRow(at: indexPath, to: IndexPath(row: 0, section: 1))
tableView.endUpdates()
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1921 次 |
| 最近记录: |