Console error: UICollectionView must be initialized with a non-nil layout parameter

后端 未结 2 1709
忘了有多久
忘了有多久 2020-12-21 08:26

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

2条回答
  •  天命终不由人
    2020-12-21 09:24

    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"];
    

提交回复
热议问题