2012-02-22 67 views
0

任何机构都可以告诉我如何实现此目的。我想用动画从tableview中删除一行。这里不用我的示例代码UITableView:应用程序崩溃尝试删除一行

[section0ARR removeObjectAtIndex:row]; 
    NSIndexPath *index = [NSIndexPath indexPathForRow:section inSection:row]; 
    [myTableVEW beginUpdates]; 
    [myTableVEW deleteRowsAtIndexPaths:[NSArray arrayWithObject:index] withRowAnimation:UITableViewRowAnimationFade]; 

    [myTableVEW endUpdates]; 

应用程序崩溃,而试图与这这句话断言失败 - [UITableView的_endCellAnimationsWithContext:],/SourceCache/UIKit_Sim/UIKit-1912.3/UITableView.m:1046

但事情工作完全正常,如果我只是重新加载我的表,但在这种情况下,动画是不可见的。

下面是一清单

  1. 已删除项目从数据源 从tableview中
    1. 删除的行动画

请帮我摆脱崩溃。

问候 ANKIT

+0

你有没有检查过'numberOfRow sInSection:'? – 2012-02-22 06:36:51

+0

@Invincible yupp我检查了它的预期,我跟踪了我的代码,直到它崩溃之后 – 2012-02-22 06:37:53

+0

尝试使用'tableView:commitEditingStyle:forRowAtIndexPath:'? – 2012-02-22 06:46:51

回答

1

尝试改变:

NSIndexPath *index = [NSIndexPath indexPathForRow:section inSection:row]; 

要这样:

NSIndexPath *index = [NSIndexPath indexPathForRow:row inSection:section]; 

(我假设rowsection是有效的值,因为我们没有其余的代码。)

+0

这是一个错误,是的,你放弃了这个突破 – 2012-02-22 08:40:31

相关问题