title: Delete row in table view with fetchedResultController
body: <p>During swype deleting (most importatnt lines of this method):</p>
  
  <pre><code>- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
  {
   if (editingStyle == UITableViewCellEditingStyleDelete)
    {
      Table *deleteRow = [self.fetchedResultsController objectAtIndexPath:indexPath];
      [self.managedObjectContext deleteObject:deleteRow];
      [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
    }   
  }
  </code></pre>
  
  <p>When deleting row I get this error: </p>
  
  <blockquote>
    <p>Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of rows in section 2.<br>
    The number of rows contained in an existing section after the update (1) must be equal to the number of rows contained in that section before the update (1), plus or minus the number of rows inserted or deleted from that section (0 inserted, 1 deleted) and plus or minus the number of rows moved into or out of that section (0 moved in, 0 moved out).'</p>
  </blockquote>
  
  <p>If I comment last line of code (<code>[tableView deleteRowsAtIndexPaths:...]</code>) everything works fine (but I have to refresh view to see that row was deleted).</p>
  
  <p>How to do it properly..?</p>
  
  <p>EDIT:
  Considering @Kyr Dunenkoff responce I've added:</p>
  
  <pre><code>- (void)controller:(NSFetchedResultsController*)controller didChangeObject:(id)anObject atIndexPath:(NSIndexPath*)indexPath forChangeType:(NSFetchedResultsChangeType)type newIndexPath:(NSIndexPath*)newIndexPath
  {
      UITableView *tableV = [self tableView];
      switch(type) {
          case NSFetchedResultsChangeDelete:
              [tableV deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
              break;
      }
  }
  
  - (void)controllerDidChangeContent:(NSFetchedResultsController*)controller
  {
      [[self tableView] endUpdates];
  }
  
  - (void)controllerWillChangeContent:(NSFetchedResultsController*)controller
  {
      [[self tableView] beginUpdates];
  }
  </code></pre>
  
  <p>However this didn't change the crashing &amp; error. Atm it just caused that adding new rows isn't working any more.</p>