デフォルトのセクション ヘッダーを に設定したいのですがUICollectionView
、以下のコードを使用するとクラッシュしました。
の-viewDidLoad
[feedcollectionview registerClass:[UICollectionReusableView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"cell"];
の-viewForSupplementaryElementOfKind
UICollectionReusableView *reusableview = nil;
if (kind == UICollectionElementKindSectionHeader) {
UICollectionReusableView *headerView = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"HeaderView" forIndexPath:indexPath];
[headerView setBackgroundColor:[UIColor redColor]];
reusableview=headerView;
ありがとうございました