UICollectionView NSInternalInconsistencyException出现的原因

阅读更多
'NSInternalInconsistencyException', reason: 'UICollectionView received layout attributes for a cell with an index path that does not exist: {length = 2, path = 0 - 0}'

出现这个bug的原因,主要是Collection的DataSource没有设置好,例如
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
返回nil,
或者CollectionView没有设置DataSource,xib没有拖控件。

你可能感兴趣的:(UICollectionView NSInternalInconsistencyException出现的原因)