您的位置:首页 > 产品设计 > UI/UE

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

2012-02-24 14:00 309 查看
//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 上面的使用还是使用后面那个方法比较好

具体代码如下:



效果图:



内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐