调用删除方法UITableView deleteRowsAtIndexPaths的时候就挂掉

来源:互联网 发布:windows tree命令详解 编辑:程序博客网 时间:2024/06/05 17:25

 //ios 3.0.马上做deleteAtIndexPaths的动作
  [tableView beginUpdates];
  [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath]  withRowAnimation:UITableViewRowAnimationRight];
  [tableView endUpdates];
  [tableView reloadData];

 

提倡用下面这种方法: 

 

如果上面的方法还是会崩溃的会那还可以使用以下的方法

[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:indexPath.row inSection:0]] withRowAnimation:UITableViewRowAnimationNone];

因为之前我使用两种方法都可以解决了问题

但是鉴于在iphone4 上面的使用还是使用后面那个方法比较好

 

具体代码如下:

 

 

效果图:

 

 

 

原创粉丝点击