I\'m new to UICollectionView
and I\'m following a tutorial that I found on Youtube, but i\'m stuck on an error I can\'t figure out.
When I run the app w
it is an error while registering the uicollectionviewcell view class. To resolve put the below line in your code:
[self.collectionView registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:@"myCell"];
Register Collection cell in viewDidLoad
method ::
[self.collView registerClass:[mineCell class] forCellWithReuseIdentifier:@"cvCell"];
Try this after above line:
UICollectionViewFlowLayout *flow = [[UICollectionViewFlowLayout alloc] init];
[flow setItemSize:CGSizeMake(60, 60)];
[flow setScrollDirection:UICollectionViewScrollDirectionVertical];
[self.collView setCollectionViewLayout:flow];
Here, mineCell
is my custom collectionViewCell or you can use [UICollectionViewCell class]
directly.
Thanks.