我有一个带有两个集合视图的视图控制器,每个视图控制器都有一个具有不同标识符的单元格,但由于某种原因,我得到了“无法出列”的错误 .

'无法将类型的视图出列:带有>标识符的UICollectionElementKindCell Cell - 必须为标识符注册一个nib或类,或者>在故事板中连接一个原型单元'

我不确定我做错了什么,并在AppDelegate上导致运行时错误 . 我根据另一个stackoverflow问题注册了nib,但它没有用 . 有人可以提供一些帮助吗?

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