Error could not dequeue a view of kind UICollectionElementKindCell

前端 未结 13 1363
耶瑟儿~
耶瑟儿~ 2020-12-16 09:34

Taking first plunge with collection views and am running into this error:

Terminating app due to uncaught exception \'NSInternalInconsistencyException

13条回答
  •  庸人自扰
    2020-12-16 10:11

    Swift4.0

    Whenever your UITableViewCell is xib at that time you must have to register with UITableView.

    override func viewDidLoad(){
        super.viewDidLoad()
    
        self.yourtableview.register(UINib(nibName: "yourCellXIBname", bundle: Bundle.main), forCellReuseIdentifier: "YourCellReUseIdentifier")
       }
    

提交回复
热议问题