1

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

它在线上发生dataSource.apply(snapshot)

当试图在 Xcode 12 beta 4 上运行它时,我遇到了以下崩溃:

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 上运行良好。

为什么会发生这种情况?

4

1 回答 1

0

这种情况下的解决方案是将数据源代码移出viewDidLoad和移入viewDidAppear.

看起来它与某些时间问题或 tvOS 上的某些东西有关,并且确实看起来是 SDK 中的错误。

于 2020-08-07T20:08:17.563 回答