`
lizhuang
  • 浏览: 887451 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

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没有拖控件。
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics