【发布时间】:2016-08-03 10:42:20
【问题描述】:
我有 2 sections 和 1 / 59 行。
我删除了行(所以在 0 部分中我得到了 0 行),并得到了这个崩溃(也在-[UITableView deleteRowsAtIndexPaths:withRowAnimation:] 处的断点有效)。无法得到这个 1 删除)是如何计算的。
Invalid update: invalid number of sections. The number of sections contained in the table view after the update (2) must be equal to the number of sections contained in the table view before the update (2), plus or minus the number of sections inserted or deleted (0 inserted, 1 deleted)
我收到此消息,但根本没有删除部分,-[UITableView deleteSections:withRowAnimation:] 处的断点不起作用。
有什么想法/建议吗?
谢谢!
【问题讨论】:
-
显示更多您尝试过的代码。
-
beginUpdates/endUpdates之间没有调用reloadData
-
删除后是否更新了部分?
标签: ios swift uitableview