title: ios delete row from table in ViewController
body: <p>I try to manage to delete a row from an <code>UITable</code> which is part on an <code>UIViewController</code>. I use the <code>Edit</code> button in the navigation bar. Hitting it will put the table rows in edit mode. But when a delete button in a row is pressed I get an error <code>...'Invalid update: invalid number of rows in section 0….</code> when using the following:</p>
  
  <pre><code>- (void)setEditing:(BOOL)editing animated:(BOOL)animated {
  [super setEditing:editing animated:animated];
  [self.tableView setEditing:editing animated:YES];
  
  }
  
  - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
      if (editingStyle == UITableViewCellEditingStyleDelete) {
          NSMutableArray *work_array = [NSMutableArray arrayWithArray:self.inputValues];
          [work_array removeObjectAtIndex:indexPath.row];
          [self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
      }
  }
  </code></pre>
  
  <p>What do I miss here? The <a href="https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/TableView_iPhone/ManageInsertDeleteRow/ManageInsertDeleteRow.html" rel="nofollow">Apple</a> documentation seems to be outdated somehow.
  Thanks</p>