UICollectionView & amp; UICollectionReusableView personnalisé ne fonctionne pas

Je suis en train d'utiliser personnalisée UICollectionReusableView (qui a la même catégorie et XIB) dans mon UICollectionView en-tête. Mais après l'extraction de données à la place de la tête, je n'ai rien.

Mon étapes:

  1. L'enregistrement de classe dans viewDidLoad:
     [self.collectionView registerClass:[CollectionViewHeader class] 
      forSupplementaryViewOfKind: UICollectionElementKindSectionHeader 
      withReuseIdentifier:@"HeaderView"];
  2. En essayant de montrer:
    - (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath
    {
    UICollectionReusableView *reusableView = nil;
    
    if (kind == UICollectionElementKindSectionHeader) {
        CollectionViewHeader *collectionHeader = [self.collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"HeaderView" forIndexPath:indexPath];
    
        NSInteger section = [indexPath section];
        id <NSFetchedResultsSectionInfo> sectionInfo = [fetchRecipes sections][section];
        collectionHeader.headerLabel.text = @"bla-bla-bla";
    
        reusableView = collectionHeader;
    }
    
    return reusableView;
    }

Quelqu'un peut-il me dire quel est le problème? )
Merci pour tous les conseils

source d'informationauteur Romowski