iOS11下的tabview侧滑删除崩溃(偶尔发生)

环境:ios11 、 xcode 9

## - demo 代码

- (void)tableView:(UITableView*)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath*)indexPath {

if(editingStyle ==UITableViewCellEditingStyleDelete) {

NSLog(@"indexPath.row = %ld",(long)indexPath.row);

//ios 11.1下的bug 删除指定row会crash

//[tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];

[tableView reloadData];

}

}

据说是 ios11.1 的bug,见连接 https://forums.developer.apple.com/thread/88190 ios11.2已修复

比较无奈的解决办法:

直接  [tableView reloadData]; 

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容