Have you registered your CollectionViewCells?
If you did this,
dequeueReusableCellWithReuseIdentifier:forIndexPath:
should create a cell for you if there is no cell to be reused.
IN
- (void)viewDidLoad
register your cells with CollectionView
UINib *galleryCellNib = [UINib nibWithNibName:@"GalleryCell" bundle:nil]; [self.collectionView registerNib:galleryCellNib forCellWithReuseIdentifier:@"Gallery_Cell"];
or
[self.collectionView registerClass:[GalleryCell class] forCellWithReuseIdentifier:@"Gallery_Cell"];
Depending on whether you use xib or just a class
source share