title: could not dequeue a view of kind: UICollectionElementKindCell with identifier
body: <p>I am working on creating a collectionview. I set up the CollectionViewController programmatically and create a customCell file as well. I design the cells in the storyboard. I have done this before, and it has worked perfectly. But for some reason, I keep getting this error. My CustomCell class is connected in the storyboard. The identifier is exactly the same as the one specified in the collectionviewcontroller method. I've cleaned, quit, and restarted xcode. I've even tried to run the collectionviewcontroller with another cell interface that I know works. No matter what I do, I keep getting this identifier issue. Here is some code</p>
  
  <pre><code>import Foundation
  
  import UIKit
  
  import Alamofire
  
  class CommentsCollectionViewController: UICollectionViewController, UICollectionViewDelegateFlowLayout {
      override func viewDidLoad() {
          super.viewDidLoad()
  
          self.collectionView?.backgroundColor = UIColor(white: 0.85, alpha: 1)
      }
  
      override func didReceiveMemoryWarning() {
          super.didReceiveMemoryWarning()
          // Dispose of any resources that can be recreated.
      }
  
      override func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -&gt; Int {
          return 1
      }
  
      override func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -&gt; UICollectionViewCell {
          let cellIdentifier = "CommentsCollectionViewCell"
          let cell = collectionView.dequeueReusableCellWithReuseIdentifier(cellIdentifier, forIndexPath: indexPath) as! CommentsCollectionViewCell
  
          return cell
      }
  
  }
  </code></pre>
  
  <p>Here is my CollectionViewCell:</p>
  
  <pre><code>import Foundation
  import UIKit
  import Cosmos
  
  class CommentsCollectionViewCell: UICollectionViewCell {
  
      @IBOutlet weak var profileImageView: UIImageView!
      @IBOutlet weak var usernameLabel: UILabel!
      @IBOutlet weak var userRatingView: CosmosView!
      @IBOutlet weak var compatibilityLabel: UILabel!
      @IBOutlet weak var commentLabel: UILabel!
  
      override func awakeFromNib() {
          super.awakeFromNib()
      }
  }
  </code></pre>
  
  <p><a href="http://i.stack.imgur.com/rVXL8.png" rel="nofollow">StoryboardIdentityInspector</a></p>
  
  <p><a href="http://i.stack.imgur.com/suq51.png" rel="nofollow">StoryboardAttributesInspector</a></p>
  
  <p>Here is my error:</p>
  
  <p>2016-07-01 10:55:40.349 ViewerReviewsApp[6377:289741] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'could not dequeue a view of kind: UICollectionElementKindCell with identifier CommentCell - must register a nib or a class for the identifier or connect a prototype cell in a storyboard'</p>
  
  <p>*** First throw call stack:
  (
      0   CoreFoundation                      0x000000010e05bd85 <strong>exceptionPreprocess + 165
      1   libobjc.A.dylib                     0x00000001104c7deb objc_exception_throw + 48
      2   CoreFoundation                      0x000000010e05bbea +[NSException raise:format:arguments:] + 106
      3   Foundation                          0x000000010eb74d5a -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 198
      4   UIKit                               0x000000010f7d4a60 -[UICollectionView _dequeueReusableViewOfKind:withIdentifier:forIndexPath:viewCategory:] + 2009
      5   UIKit                               0x000000010f7d4ebc -[UICollectionView dequeueReusableCellWithReuseIdentifier:forIndexPath:] + 169
      6   ViewerReviewsApp                    0x000000010d729ee7 _TFC16ViewerReviewsApp25CommentFeedViewController14collectionViewfTCSo16UICollectionView22cellForItemAtIndexPathCSo11NSIndexPath_CSo20UICollectionViewCell + 151
      7   ViewerReviewsApp                    0x000000010d729f9f _TToFC16ViewerReviewsApp25CommentFeedViewController14collectionViewfTCSo16UICollectionView22cellForItemAtIndexPathCSo11NSIndexPath_CSo20UICollectionViewCell + 79
      8   UIKit                               0x000000010f7c308f -[UICollectionView _createPreparedCellForItemAtIndexPath:withLayoutAttributes:applyAttributes:isFocused:] + 483
      9   UIKit                               0x000000010f7c6d96 -[UICollectionView _updateVisibleCellsNow:] + 4988
      10  UIKit                               0x000000010f7cb575 -[UICollectionView layoutSubviews] + 258
      11  UIKit                               0x000000010f006980 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 703
      12  QuartzCore                          0x0000000115522c00 -[CALayer layoutSublayers] + 146
      13  QuartzCore                          0x000000011551708e _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 366
      14  QuartzCore                          0x0000000115516f0c _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
      15  QuartzCore                          0x000000011550b3c9 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 277
      16  QuartzCore                          0x0000000115539086 _ZN2CA11Transaction6commitEv + 486
      17  UIKit                               0x000000010ef7819b _afterCACommitHandler + 174
      18  CoreFoundation                      0x000000010df80c37 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION</strong> + 23
      19  CoreFoundation                      0x000000010df80ba7 __CFRunLoopDoObservers + 391
      20  CoreFoundation                      0x000000010df767fb __CFRunLoopRun + 1147
      21  CoreFoundation                      0x000000010df760f8 CFRunLoopRunSpecific + 488
      22  GraphicsServices                    0x00000001153e5ad2 GSEventRunModal + 161
      23  UIKit                               0x000000010ef4bf09 UIApplicationMain + 171
      24  ViewerReviewsApp                    0x000000010d738ad2 main + 114
      25  libdyld.dylib                       0x0000000111d1392d start + 1
  )</p>
  
  <p>Is there anything else I can do to make this work?</p>