*** Assertion failure in -[UICollectionView _createPreparedSupplementaryViewForElementOfKind:atIndex...

出现此错误的原因就是下面的方法里面

- (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath

不可 alloc 你想要的view 需要通过collectionView的

dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionFooter withReuseIdentifier:kProductSectionFooterIdentifier forIndexPath:indexPath

方法复用

 

转载于:https://www.cnblogs.com/ycq-firstBlood/p/5026617.html

你可能感兴趣的:(*** Assertion failure in -[UICollectionView _createPreparedSupplementaryViewForElementOfKind:atIndex...)