Could not cast value of type 'UICollectionViewCell'

后端 未结 6 1123
野性不改
野性不改 2021-02-01 12:21

I use a custom CollectionViewCell in my Storyboard. When I start the app I get this message:

Could not cast value of type \'UICollectionViewCell\' to T

6条回答
  •  暖寄归人
    2021-02-01 12:58

    I received this error when the custom class (on Xcode inspector) still had its class set to the default UICollectionViewCell rather than my custom class for TestProject.CollectionViewCell.

    To fix it, simply change the custom class to your implementation.

提交回复
热议问题