ios - Could not dequeue a view of kind UICollectionElementKindCell with identifier -


i have view controller 2 collection views, each 1 has cell different identifier, reason, getting 'could not dequeue' error.

'could not dequeue view of kind: uicollectionelementkindcell >identifier cell - must register nib or class identifier or >connect prototype cell in storyboard'

i not sure doing wrong , causing runtime error on appdelegate. registered nibs, based on stackoverflow question, didn't work. can provide help?

func collectionview(collectionview: uicollectionview, cellforitematindexpath indexpath: nsindexpath) -> uicollectionviewcell {         let cell2 = collectionview.dequeuereusablecellwithreuseidentifier("cell2", forindexpath: indexpath)         let cell = collectionview.dequeuereusablecellwithreuseidentifier("cell", forindexpath: indexpath)         if collectionview == collview {         if defaults.boolforkey("gotpl") {             let thumbiv = cell.viewwithtag(1) as! uiimageview             let playtitle = cell.viewwithtag(2) as! uilabel              thumbiv.image = uiimage(data: defaults.arrayforkey("playlistthumbnails")![indexpath.row] as! nsdata)             playtitle.text = defaults.arrayforkey("playlisttitles")![indexpath.row] as? string             return cell } else { return cell }} else {              if defaults.boolforkey("gotrecom") {                 let thumbiv = cell2.viewwithtag(3) as! uiimageview                 let videotitle = cell2.viewwithtag(4) as! uilabel                 thumbiv.image = uiimage(data: defaults.arrayforkey("recomthumbs")![indexpath.row] as! nsdata)                 videotitle.text = defaults.arrayforkey("recomtitles")![indexpath.row] as? string                 return cell2             } else { return cell2 }}     } 

enter image description here


Comments