title: Must register a nib or a class for the identifier or connect a prototype cell in a storyboard
body: <p>I have a table view when when you tap into one of it's rows, it will instantiate another <code>UITableViewController</code>. However, I have getting this code: <code>must register a nib or a class for the identifier or connect a prototype cell in a storyboard</code></p>
  
  <p>Here is the storyboard:</p>
  
  <p><a href="https://i.stack.imgur.com/7pBSg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7pBSg.png" alt="enter image description here"></a></p>
  
  <p>Here is my code</p>
  
  <p>The first UITableViewController</p>
  
  <pre><code>class MainActivityViewController: UITableViewController {
  
      let node = MenuStructure.structure.childenNode
  
      override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
          return node.count
      }
  
      override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
          let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath)
          cell.textLabel?.text = node[indexPath.row].value
          return cell
      }
  
      override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
          let selectedNode = node[indexPath.row]
          let subMenuViewController = SubMenuViewController(node: selectedNode)
  
          navigationController?.pushViewController(subMenuViewController, animated: true)
  
      }
  
      override func viewDidLoad() {
          super.viewDidLoad()
          // Do any additional setup after loading the view, typically from a nib.
          //self.navigationItem.title = MenuStructure.structure.value
  
      }
  }
  </code></pre>
  
  <p>Then when you tap into one of it's row it will segue to this UITableViewController</p>
  
  <pre><code>class SubMenuViewController: UITableViewController {
  
      let node: Node
  
      init(node: Node) {
          self.node = node
          super.init(nibName: nil, bundle: nil)
      }
  
      required init?(coder aDecoder: NSCoder) {
          fatalError("required initializer not implemented")
      }
  
      override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
          return node.childenNode.count
      }
  
      override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
          tableView.register(UITableViewCell, forCellReuseIdentifier: "cell")
          let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath)
          cell.textLabel?.text = node.childenNode[indexPath.row].value
          return cell
      }
  
      override func viewDidLoad() {
     }
  }
  </code></pre>
  
  <p>I have tried registering my cells but I don't understand how and don't know where to put it.</p>
  
  <p>Any suggestions are welcome!thanks!</p>
  
  <p><strong><em>UPDATED CODE</em></strong></p>
  
  <pre><code>class SubMenuViewController: UITableViewController {
  
      let node: Node
  
      init(node: Node) {
          self.node = node
          super.init(nibName: nil, bundle: nil)
      }
  
      required init?(coder aDecoder: NSCoder) {
          fatalError("required initializer not implemented")
      }
  
      override func numberOfSections(in tableView: UITableView) -&gt; Int {
          return 1
      }
  
      override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -&gt; Int {
          return node.childenNode.count
      }
  
      override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&gt; UITableViewCell {
          let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath)
          cell.textLabel?.text = node.childenNode[indexPath.row].value
          return cell
      }
  
      override func viewDidLoad() {
          super.viewDidLoad()
          tableView.register(UITableViewController.self, forCellReuseIdentifier: "cell")
      }
  }
  </code></pre>