Can anyone tell me what is going on in this error code
[UIViewController collectionView:numberOfItemsInSection:]: unrecognized selector sent to instance 0x8c
To fix unrecognized selector sent to instance 0x8c9a6d0, you must respect two rules:
1) You have to confirm that all IBOutlet connections exist in cell class. Confirm IBOutlet connection by clicking an item in your cell, for ex. Title label and in the right side of XCode click "Show the Connections inspector" round icon with right arrow "->". You you have many connections and you are confused, please remove all connections and connect them again in cell class.
2) You have to add delegates and datasource for that collectionView in viewDidLoad:
override func viewDidLoad() {
super.viewDidLoad()
collectionView.delegate = self
collectionView.dataSource = self
}
PS. If you have uicollectionview cell inside tableview cell you must add delegates and datasource inside that cell class, adding with storyboard with drag and not seems not working on Xcode 10.1.
override func awakeFromNib() {
super.awakeFromNib()
collectionView.delegate = self
collectionView.dataSource = self
}