'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没有拖控件。