码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2015-08-05 18:24:41      阅读:454      评论:0      收藏:0      [点我收藏+]

标签:

问题:(删除tableview中的section时)

 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 (5) must be equal to the number of sections contained in the table view before the update (5), plus or minus the number of sections inserted or deleted (0 inserted, 1 deleted).‘


解决:

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

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

    

    [_arrayTableCellData removeObjectAtIndex:row];

    [self.tableview endUpdates];

版权声明:本文为博主原创文章,未经博主允许不得转载。

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

标签:

原文地址:http://blog.csdn.net/yishengzhiai005/article/details/47300531

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!