首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >UICollectionView断言失败在-[UICollectionView _updateWithItems:tentativelyForReordering:]

UICollectionView断言失败在-[UICollectionView _updateWithItems:tentativelyForReordering:]
EN

Stack Overflow用户
提问于 2015-07-15 17:14:42
回答 1查看 7.7K关注 0票数 16

第8.4条。在设备而不是模拟器上。

我得到这个卡什错误;

Assertion failure in -[UICollectionView _updateWithItems:tentativelyForReordering:], /SourceCache/UIKit/UIKit-3347.44.2/UICollectionView.m:4563

当我打电话的时候

代码语言:javascript
复制
NSArray* array_indexPaths = [NSArray arrayWithObject:[NSIndexPath indexPathForRow:1 inSection:0]];
[self.collectionView reloadItemsAtIndexPaths:indexPaths];

在没有运气的情况下,尝试将上面的内容放入[self.collectionView performBatchUpdates:^{中。

有没有其他人经历过这种情况,或者知道发生了什么?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-04-26 11:25:13

我找到了这个雷达:http://www.openradar.me/26280932,上面写着:

在_endItemAnimationsWithInvalidationContext:tentativelyForReordering:.中调用insertItemsAtIndexPaths:在viewDidLoad之后但在viewDidAppear:之前调用UICollectionView将导致断言失败在同一个场景中调用reloadData不会生成断言。

因此,您可以在viewDidAppear之前检查是否正在执行调用,并在视图出现之前进行调整/等待。

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

https://stackoverflow.com/questions/31436889

复制
相关文章

相似问题

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