title: NSInternalInconsistencyException error registering own cell (ios, swift)
body: <p>I try to use my own cell in a taleview and I get the following error. I checked various samples (also in stackoverflow) and even did not manage to get it running. Can someone see what I am doing wrong ?</p>
  
  <p>Error:</p>
  
  <pre><code>2015-05-10 07:55:53.145 Prototypes[915:19191] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle &lt;/Users/user/Library/Developer/CoreSimulator/Devices/FE514C52-DD27-4114-A51F-2A837A6E9CF2/data/Containers/Bundle/Application/9AA69B81-4001-4E95-8DD8-2D0B742B175A/Prototypes.app&gt; (loaded)' with name 'ResultsCell''
  </code></pre>
  
  <p>Code:
  UIViewController:
  var searchResults: UITableView  =   UITableView();</p>
  
  <p>class SearchViewController: UIViewController,UITableViewDataSource, UITableViewDelegate/<em>, UITableViewDataSource</em>/ {
      var arrayResults: [(EventID: Int, sTitle: String)] = [];</p>
  
  <pre><code>override func viewDidLoad() {
          let data = (EventID: 0, sTitle: "MyEvent 0");
          arrayResults.append(data);
  
          let fSearchResultY:CGFloat=fButtonHeight+fButtonY;
          searchResults.frame = CGRectMake(0, fSearchResultY, screenwidth, screenheight-fSearchResultY);
  
          searchResults.delegate      =   self;
          searchResults.dataSource    =   self;
  
          let nibName = UINib(nibName: "ResultsCell", bundle:nil)
          searchResults.registerNib(nibName, forCellReuseIdentifier: "Cell")
  
          self.view.addSubview(searchResults);
  }
  </code></pre>
  
  <p>UITableViewCell:</p>
  
  <pre><code>import UIKit
  
  class ResultsCell: UITableViewCell {
      var cellImage: UIImageView
      var cellTitle: UILabel
      required init(coder aDecoder: NSCoder) {
          fatalError("init(coder:) has not been implemented")
      }
      override init(style: UITableViewCellStyle, reuseIdentifier: String!) {
          cellImage=UIImageView();
          cellTitle=UILabel();
          super.init(style: style, reuseIdentifier: reuseIdentifier)
      }
      override func awakeFromNib() {
          super.awakeFromNib()
          // Initialization code
      }
      override func setSelected(selected: Bool, animated: Bool) {
          super.setSelected(selected, animated: animated)
          // Configure the view for the selected state
      }
  }
  </code></pre>
  
  <p>UPDATE after suggestions:</p>
  
  <p>I replaced </p>
  
  <pre><code>    let nibName = UINib(nibName: "ResultsCell", bundle:nil)
      searchResults.registerNib(nibName, forCellReuseIdentifier: 
  </code></pre>
  
  <p>"Cell")
  with</p>
  
  <pre><code>searchResults.registerClass(ResultsCell.self, forCellReuseIdentifier: "cell");
  </code></pre>
  
  <p>But then I get:</p>
  
  <pre><code>*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'unable to dequeue a cell with identifier Cell - must register a nib or a class for the identifier or connect a prototype cell in a storyboard'
  </code></pre>