iOS exception ‘NSInternalInconsistencyException’, reason: ‘UICollectionView dataSource is not set’
2016-08-31 16:13:34.189 xxxx[1424:25534] *** Assertion failure in -[UICollectionView _createPreparedSupplementaryViewForElementOfKind:atIndexPath:withLayoutAttributes:applyAttributes:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3512.60.7/UICollectionView.m:1599
2016-08-31 16:13:34.278 xxxx[1424:25534] *** Terminating app due to uncaught exception ‘NSInternalInconsistencyException’, reason: ‘UICollectionView dataSource is not set’
出现这个错误的情况是我设置了collectionView中每个section的header
而且错误并不是想错误描述的UICollectionView dataSource is not set没有设置数据源
根本原因是我们在设置headerView或者footerView时,必现要创建类才行,LSHeaderView : UICollectionReusableView
© 版权声明
文章版权归作者所有,未经允许请勿转载。
相关文章
暂无评论...