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

iOS UITableView删除组中唯一行,即[UITableView _endCellAnimationsWithContext:] warning

2016-03-03 21:29 417 查看
在iOS项目中要删除某一行,此行是此组中最后一行,在使用 UITableView 的方法:

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()
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: