我在删除具有淡入淡出效果的表格 View 中的单元格时遇到了一个未知问题。下面是删除单元格的代码
[self.recordArray removeObjectAtIndex: indexPath.row];
[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath]
withRowAnimation:UITableViewRowAnimationFade];
当我执行滑动删除操作时,应用程序挂起。任何人都可以建议这里有什么问题吗?
我在 scrollViewDidScroll
委托(delegate)中编写了几行具有 for 循环的代码。它是否会导致挂起 table ,但据我所知,“scrollViewDidScroll”会在用户触摸时被调用。请提出建议。
最佳答案
[YourArray removeObjectAtIndex:indexPath.row];
[tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation: UITableViewRowAnimationFade];
不要在索引路径中使用“[NSArray arrayWithObject:indexPath]”,只需使用要删除的索引路径即可。
关于ios - 删除具有淡入淡出效果的单元格时 UItableView 挂起,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44787390/