title: Must register a nib or a class for the identifier or connect a prototype cell
body: <p>I have a default master-detail table view with a <a href="https://github.com/twotoasters/TWTSideMenuViewController" rel="nofollow noreferrer">menu</a>. The menu works, but for some reason I get the following error when pressing the '+' button to add another cell in my app:</p>
  
  <blockquote>
    <p>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'</p>
  </blockquote>
  
  <p>I searched for a solution for days</p>
  
  <p>If I add to <code>viewDidLoad</code>:</p>
  
  <pre><code>[self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:cellIdentifier];
  </code></pre>
  
  <p>I don't get the error, but the cells that are added aren't the ones configured in my storyboard, nor do they point to the detail view controller.</p>
  
  <p>I have checked multiple times if the identifier field for the prototype cell has been filled in and is the same as *cellIdentifier.</p>
  
  <p>From what I know it seems of the same nature as the question asked <a href="https://stackoverflow.com/questions/14250563/dynamic-prototype-cells-in-uitableviewcontroller-using-storyboards">here</a>.</p>
  
  <p>Any help would be appreciated and if you have the time please explain why it's wrong what I did or why certain code should be added.</p>
  
  <p>Requested code (both are default code added by Xcode 5.0.1):</p>
  
  <pre><code>// Code to add the button
  
  UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(insertNewObject:)];
  self.navigationItem.rightBarButtonItem = addButton;
  
  // Code called when button is pressed:
  
  - (void)insertNewObject:(id)sender
  {
      if (!_objects) {
          _objects = [[NSMutableArray alloc] init];
      }
          [_objects insertObject:[NSDate date] atIndex:0];
          NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0];
          [self.tableView insertRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationAutomatic];
      }
  }
  
  - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  {
      UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier forIndexPath:indexPath];
  
      NSDate *object = _objects[indexPath.row];
      cell.textLabel.text = [object description];
      return cell;
  }
  </code></pre>
  
  <p>Also check out the pictures and project files added in the comment</p>