UICollectionView Using Swift

后端 未结 4 2155
生来不讨喜
生来不讨喜 2020-12-18 09:01

In My Project I created Cell in UICollectionViewCell

Its got Error Terminating app due to uncaught exception

The code as follow.

GalleryCell.

4条回答
  •  时光说笑
    2020-12-18 09:36

    I wanted to add another answer that helped me, in case it becomes useful to someone else.

    It seems that everyone else has solved this problem through the use of registerNib:forCellWithReuseIdentifier: or registerClass:forCellWithReuseIdentifier:. For me, there was a different resolution: in my storyboard, I selected the header and looked over in the Identity Inspector in the top section where it has fields for my Custom Class. Specifically, the Module field was blank. I needed to pull down the arrow next to that field and select the right target.

    Once I did this & saved the storyboard, the above crash no longer happened and I could see my custom header.

提交回复
热议问题