Invalid update: invalid number of sections. The number of sections contained in the table view afte

Assertion failure in -[UITableView _endCellAnimationsWithContext:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit/UIKit-3599.6.1/UITableView.m:1594
2018-09-10 17:34:42.780652 HDBluetoothHelper[1373:639862] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of sections.  The number of sections contained in the table view after the update (1) 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 (1 inserted, 1 deleted).'
*** First throw call stack:
(0x1846d81c0 0x18311055c 0x1846d8094 0x18516282c 0x18a703f64 0x18a700a8c 0x100030da0 0x10005f6b8 0x18a5567b0 0x18a556730 0x18a540be4 0x18a55601c 0x18aae6f30 0x18aae2fc8 0x18aae2ae8 0x18aae1da4 0x18a550d70 0x18a521858 0x18ad0ecb8 0x18ad08720 0x184686278 0x184685bc0 0x1846837c0 0x1845b2048 0x186035198 0x18a58c628 0x18a587360 0x100036eec 0x1835945b8)
libc++abi.dylib: terminating with uncaught exception of type NSException

解决办法:

[self.tableview beginUpdates];    // 必须添加 开始更新  和结束更新,中间必须删除 数据

 [self.tableview deleteSections:indexset withRowAnimation:UITableViewRowAnimationRight];    

 [_arrayTableCellData removeObjectAtIndex:row];

 [self.tableview endUpdates];

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值