title: Load UITableViewCell Nib in UITableView Nib
body: <p>I'm trying to load custom UITableViewCell nib in UITableView Nib. However, I'm unable to load the data in the table view. The app crashes with error 'libc++abi.dylib: terminating with uncaught exception of type NSException'</p>
  
  <p>This is what I did:
  1. use a single ViewController to load two .xib files -- one for a UITableView and one for the UITableCellView.</p>
  
  <ol start="2">
  <li><p>drop a UITableView to TableViewNib.xib file. I set the file's class to ViewController and put an outlet to reference the tableView</p></li>
  <li><p>This is the ViewController Code</p>
  
  <pre><code>class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
  
  @IBOutlet weak var tableView: UITableView!
  
  override func viewDidLoad() {
  super.viewDidLoad()
  
  self.tableView.delegate = self
  self.tableView.dataSource = self
  </code></pre></li>
  <li><p>Create Custom Table View Cell object into an empty TableCellNib.xib file. I added a Custom Class and an identifier like TableCellId</p>
  
  <pre><code>class TableCell: UITableViewCell {
  
  @IBOutlet weak var nameLabel: UILabel!
  
  }
  </code></pre></li>
  <li><pre><code>    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell
  {
       print("I am here!")
  
       let ingredient = self.ingredients[indexPath.row]
          ViewController.register(UINib(nibName: "ViewController", bundle: nil), forCellReuseIdentifier: "TableCellId")
  
  guard let cell = tableView.dequeueReusableCell(withIdentifier: "TableCellID", for: indexPath) as? 
   TableViewCell else { return UITableViewCell() }
  
  
        return cell
  
      }
  </code></pre></li>
  </ol>