title: NSInternalInconsistencyException while adding row to UITableView
body: <p>I have trouble with adding new row to my UITableView. I read similar questions on stackoverflow, googled it, ... didn't help me.</p>
  
  <p>I have empty NSMutableArray *dataForList with data for UITableView. After click on screen I want to add new row. This error shows: </p>
  
  <blockquote>
    <p><em>*</em> Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'attempt to insert row 0 into section 0, but there are only 0 rows in section 0 after the update'</p>
  </blockquote>
  
  <p>Code:</p>
  
  <pre><code>NSArray *insertIndexPaths = [NSArray arrayWithObject: 
                               [NSIndexPath indexPathForRow:
                                [self.dataForList count] // is zero now
                                inSection:0]];
  
  [self.dataForList addObject:newRow];
  // [self.dataForList count] is 1 now
  
  [self.unsignedTableView beginUpdates];
  [self.unsignedTableView insertRowsAtIndexPaths:insertIndexPaths withRowAnimation:UITableViewRowAnimationNone];
  [self.unsignedTableView endUpdates]; // on this line error ocours
  </code></pre>
  
  <p>What am I missing?</p>
  
  <p>All UITableView methods</p>
  
  <pre><code>- (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *) indexPath {}
  
  - (NSInteger) numberOfSectionsInTableView:(UITableView *)tableView {
  return 1;
  }
  
  - (NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger) section {
  return [self.mainController.dataForList count];
  }
  
  - (CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *) indexPath{
  return 38.0f;
  }
  
  - (UITableViewCell *) tableView: (UITableView *) tableView
        cellForRowAtIndexPath: (NSIndexPath *) indexPath {
  // call render method in view, it works fain
  return [self.signUpToTestView renderUnsignedCell:tableView cellForRowAtIndexPath:indexPath];
  }
  </code></pre>