iOS UITableView删除组中唯一行,即[UITableView _endCellAnimationsWithContext:] warning
2016-03-03 21:29
417 查看
在iOS项目中要删除某一行,此行是此组中最后一行,在使用 UITableView 的方法:
但未能成功,Warning:Assertion failure in -[UITableView _endCellAnimationsWithContext:], /SourceCache/UIKit_Sim/UIKit-2372/UITableView.m:1070
后查找Baidu发现一篇博客:http://blog.sina.com.cn/s/blog_7b9d64af0101b6se.html
修改代码:
self.tableView.deleteRowsAtIndexPaths([indexPath], withRowAnimation: .None)
但未能成功,Warning:Assertion failure in -[UITableView _endCellAnimationsWithContext:], /SourceCache/UIKit_Sim/UIKit-2372/UITableView.m:1070
后查找Baidu发现一篇博客:http://blog.sina.com.cn/s/blog_7b9d64af0101b6se.html
修改代码:
self.tableView.beginUpdates() self.tableView.deleteSections(NSIndexSet(index: indexPath.section), withRowAnimation: .None) self.tableView.deleteRowsAtIndexPaths([indexPath], withRowAnimation: .None) self.tableView.endUpdates()
相关文章推荐
- PAT-A1062. Talent and Virtue (25)(排序)
- 分享20个最新的免费 UI 设计素材给设计师
- PAT-A1041. Be Unique (20)
- UIView的拖拽
- 多语言Values
- xib自定义UIView报错误 "forUndefinedKey:]: this class is not key value coding-compliant for the key"
- android sdk中tools混淆插件proguardgui.bat简单说明
- UIImagePickerViewController裁切头像
- Educational Codeforces Round 9-D. Longest Subsequence(筛选法)
- UICollectionView-集合视图(理论篇)
- iOS UITableView相关成员方法详解
- HDU 4010 Query on The Trees
- String、StringBuilder、StringBuffer的区别
- SPOJ QTREE - Query on a tree
- question_015-JAVA之Map的遍历方式
- String 与StringBuilder
- Class Of Marquee Scroll通用不间断滚动JS脚本
- ProcessBuilder中如何为命令行传参
- UI控件初始化问题:initWithFrame和initWithCoder、aweakFromNib的执行
- 谈谈UIView的几个layout方法-layoutSubviews、layoutIfNeeded、setNeedsLayout