插入和删除时UItableview动画崩溃

时间:2013-10-16 09:03:26

标签: iphone ios ipad uitableview

uncaught exception NSInternalInconsistencyException

而终止应用

原因: Cell animation stop fraction must be greater than start fraction 使用时

[self.tableView insertRowsAtIndexPaths:indexPathsToInsert withRowAnimation:insertAnimation];
[self.tableView deleteRowsAtIndexPaths:indexPathsToDelete withRowAnimation:deleteAnimation];

1 个答案:

答案 0 :(得分:0)

它在iOS7.x上的错误解决方案是删除以下代表,

tableView:viewForFooterInSection:
tableView:heightForFooterInSection:

并将其替换为viewDidLoad中的以下代码行。

tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];