您当前的位置: 首页 >  ui

SwiftUI更新List时出现 UITableView internal inconsistency 崩溃的原因及解决

发布时间:2022-05-16 17:08:55 ,浏览量:0

在这里插入图片描述

问题现象

SwiftUI在更新包含复杂项目的List界面时,可能会导致App崩溃,且出现如下错误信息:

Terminating app due to uncaught exception ‘NSInternalInconsistencyException’, reason: ‘UITableView internal inconsistency: encountered out of bounds global row index while preparing batch updates (oldRow=xx, oldGlobalRowCount=xx)’ terminating with uncaught exception of type NSException

为什么会出现这种问题?又该如何解决呢?

这个问题貌似很棘手,其实修复也很简单。

那还等什么呢?

Let’s dive in right now!

问题分析 1. 卢克,上源代码!

为了更好的了解事情的全部真相,我们有必要先熟悉一下“案发现场”,从源代码看一下到底有什么问题:

enum 
关注
打赏
1688896170
查看更多评论

暂无认证

  • 0浏览

    0关注

    108180博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文
立即登录/注册

微信扫码登录

0.0776s