iOS Assertion Failure in UICollectionView

后端 未结 7 1387
抹茶落季
抹茶落季 2020-12-17 08:07

I\'m getting the error ...

*** Assertion failure in -[UICollectionView _dequeueReusableViewOfKind:withIdentifier:forIndexPath:], /SourceCache/UIKit/UIKit-237         


        
7条回答
  •  天命终不由人
    2020-12-17 09:04

    I had the same problem. Here's how I solved it.

    Move

    [self.pictureCollectionView registerNib:[UINib nibWithNibName: bundle:nil] forCellWithReuseIdentifier:reuseID]

    to be in - (void)viewDidLoad,

    rather than method - (void)awakeFromNib.

提交回复
热议问题