首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >tvOS 13 DiffableDataSource无效参数不满足要求: itemCount

tvOS 13 DiffableDataSource无效参数不满足要求: itemCount
EN

Stack Overflow用户
提问于 2020-08-08 04:08:18
回答 1查看 42关注 0票数 1

当启动我的tvOS应用程序时,我得到了一个与DiffableDataSource:Thread 1: Expection: "Invalid parameter not satisfying: itemCount"相关的崩溃。

它发生在dataSource.apply(snapshot)行上。

当我试图在Xcode12beta4上运行它时,我得到了以下崩溃:

代码语言:javascript
复制
Thread 1: "Invalid update: invalid number of sections. The number of secxtions contained in the collection view after the update (1) must be equal to the number of sections contained in the collection view before hte update (1), plus or minus the number of sections inserted or deleted (1 inserted, 0 deleted)."

这是更详细的,但仍然没有给出为什么会发生这种情况的信息。

相同的代码在iOS上运行良好。

为什么会发生这种情况?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-08-08 04:08:18

这种情况下的解决方案是将dataSource代码从viewDidLoad移到viewDidAppear中。

它看起来像是与tvOS上的一些计时问题或什么有关,并且看起来确实是SDK中的错误。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63308556

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档