iOS Assertion Failure in UICollectionView

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

I\'m getting the error ...

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


        
7条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-17 08:45

    Been reading the docs (should possibly have done this first :) )

    Anyway, the collectionView I am using is within a separate xib file (not a storyboard) and from the docs...

    Important: You must register a class or nib file using the
    registerClass:forCellWithReuseIdentifier: or
    registerNib:forCellWithReuseIdentifier: method before calling this method.
    

    Thanks

提交回复
热议问题