删除tableview的section遇到crash:The number of rows contained in an existing section after the update
来源:互联网 发布:linux syslog server 编辑:程序博客网 时间:2024/05/29 18:50
原因:删section必须用deleteSections。 删row必须用deleteRowsAtIndexPaths。
另外,删了后,数据源需要相应地删,否则数据不一致,crash
- (void)ignore:(NSInteger)sectionIdx
{
[_tableView beginUpdates];
//[_tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationNone];
[_tableView deleteSections:[NSIndexSet indexSetWithIndex:sectionIdx]
withRowAnimation:UITableViewRowAnimationFade];
[_arrOnlineFiles removeObjectAtIndex:sectionIdx];
[_tableView endUpdates];
}
refer:http://hi.baidu.com/dujun/item/55c6ca07ac704613cc34ea13
另外,删了后,数据源需要相应地删,否则数据不一致,crash
- (void)ignore:(NSInteger)sectionIdx
{
[_tableView beginUpdates];
//[_tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationNone];
[_tableView deleteSections:[NSIndexSet indexSetWithIndex:sectionIdx]
withRowAnimation:UITableViewRowAnimationFade];
[_arrOnlineFiles removeObjectAtIndex:sectionIdx];
[_tableView endUpdates];
}
refer:http://hi.baidu.com/dujun/item/55c6ca07ac704613cc34ea13
- 删除tableview的section遇到crash:The number of rows contained in an existing section after the update
- Invalid update: invalid number of rows in section 0. The number of rows contained in an ....
- ios 解决bug(2)---invalid number of rows in section 0. The number of rows contained。。。
- 一个奇葩错误:Invalid update: invalid number of rows in section 0
- iOS开发bug消灭之:Invalid update: invalid number of rows in section 0.
- 一个奇葩错误:Invalid update: invalid number of rows in section 0
- 'Invalid update: invalid number of sections. The number of sections contained in the table view aft
- IOS删除tableview'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of rows in
- tableview cell in section
- iOS解决融云的 "attempt to delete row 0 from section 0 which only contains 0 rows before the update" 问题
- How to get the content of the 'identity' section in web.config
- quick count the number of the rows in a big table
- How to Interpret the OS stats section of an AWR report (文档 ID 762526.1)
- an out of memory error has occurred.Consult the 'running eclipse' section of the read me file for...
- Update large number of rows in a table [ID 268395.1]
- Section 1.4 The Clocks
- Section 2.1 The Castle
- The bss section
- (第一天)object-c枚举和结构体
- linux命令
- HTTP Status 404(The requested resource is not available)的几种解决方法
- Zimbra用户对群组发送邮件的权限设置
- windows 下的嵌入式开发
- 删除tableview的section遇到crash:The number of rows contained in an existing section after the update
- you must specify a host type if you use `--no-verify'
- 随想录(写给那些学校不是985、211的同学们)
- java反射机制
- [小代码]通过IP和端口连接到远程摄像机
- 错误解决:Install ncurses(ncurses-devel) and try again
- vim 处理字符编码
- 事物
- 利用 Oracle 系统触发器防止误删除操作