调用删除方法UITableView deleteRowsAtIndexPaths的时候就挂掉
2015-09-16 01:44
429 查看
转自: http://blog.csdn.net/snn1410/article/details/7290516
//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 上面的使用还是使用后面那个方法比较好
具体代码如下:
效果图:
//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 上面的使用还是使用后面那个方法比较好
具体代码如下:
效果图:
相关文章推荐
- ZOJ 3892 Available Computation Sequence
- word frequency
- range for query
- POJ - 2524 Ubiquitous Religions(并查集)
- 队列queue
- iOS开发 - UISearchController实现搜索功能
- Xcode的SVN提示"The request timed out."的解决方案
- 一行代码搞定UITextView的placeholder
- android高仿微信UI点击头像显示大图片效果
- HashMap遍历 key value
- 安卓中炫酷的UI特效
- iOS开发:如何给UIViewController瘦身
- iOS UI基础-7.0 UIScrollView
- GUI
- Not Found The requested url path was not fund on this server
- UITableViewCell和UICollectionView的几种动画
- 对UIView的总结
- NEVER QUIT. NEVER SAY NEVER.
- Servlet之request请求、ServletContext、ServletConfig
- 自绘菜单的实现 ----------原作者querw