【发布时间】:2014-04-11 13:45:33
【问题描述】:
我有两个自定义布局的 collectionView,如果发生某些操作,我将从数据源中删除两个项目并尝试设置不同的集合视图
[self.tabCollectionView setCollectionViewLayout:self.basicFlowLayout animated:NO];
我收到错误:
*** Assertion failure in -[UICollectionViewData validateLayoutInRect:], /SourceCache/UIKit_Sim/UIKit-2935.137/UICollectionViewData.m:357
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UICollectionView recieved layout attributes for a cell with an index path that does not exist: <NSIndexPath: 0xbcecd60> {length = 2, path = 0 - 4}'
但是,当我只删除一项后这样做时,动画效果很好。 iOS 7上也没有问题。 一整天都在苦苦挣扎,找不到合适的解决方案来解决它。 有什么想法吗?
【问题讨论】:
-
检查此答案是否对您有帮助 [UICollectionView assertion error on stale data][1] [1]: stackoverflow.com/questions/18339030/…
-
我正在检查,但没有帮助
标签: ios ios7 uicollectionview