Thread 1: "UICollectionView internal inconsistency: attempted to set layout with the collection view requiring a reload. Collection view: <UICollectionView: 0x1071c0200; frame = (0 0; 1080 810); clipsToBounds = YES; autoresize = RM+BM; gestureRecognizers = <NSArray: 0x2813a0cc0>; backgroundColor = UIExtendedGrayColorSpace 0 0; layer = <CALayer: 0x281c7c240>; contentOffset: {0, 0}; contentSize: {0, 0}; adjustedContentInset: {0, 0, 0, 0}; layout: <UICollectionViewFlowLayout: 0x106ef5760>; dataSource: <GHControlVc: 0x1078acc00>>"
解决方法-Latout设置要在代理设置之前
之前设置
self.collectionView.delegate = self;
self.collectionView.dataSource = self;
self.collectionView.collectionViewLayout = [self collecitonViewLayout];
改为
self.collectionView.collectionViewLayout = [self collecitonViewLayout];
self.collectionView.delegate = self;
self.collectionView.dataSource = self;