当启动我的tvOS应用程序时,我得到了一个与DiffableDataSource:Thread 1: Expection: "Invalid parameter not satisfying: itemCount"相关的崩溃。
它发生在dataSource.apply(snapshot)行上。
当我试图在Xcode12beta4上运行它时,我得到了以下崩溃:
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上运行良好。
为什么会发生这种情况?
发布于 2020-08-08 04:08:18
这种情况下的解决方案是将dataSource代码从viewDidLoad移到viewDidAppear中。
它看起来像是与tvOS上的一些计时问题或什么有关,并且看起来确实是SDK中的错误。
https://stackoverflow.com/questions/63308556
复制相似问题