title: Deleting Row from TableView and coreData
body: <p>I have some problem with deleting rows from a tableView which is filled with coreData objects.</p>
  
  <p>Trying to do this:</p>
  
  <pre><code> -(void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath*)indexPath{
  
          if (editingStyle == UITableViewCellEditingStyleDelete) {
  
              [self.tableView beginUpdates];
  
              NSManagedObject *managedObject = [self.fetchedResultsController objectAtIndexPath:indexPath];
              NSLog(@"Deleting (%@)", [managedObject valueForKey:@"original_title"]);
              [self.managedObjectContext deleteObject:managedObject];
              [self.managedObjectContext save:nil];
  
              [self performFetch];       
              [self.tableView endUpdates];       
          }   
      }
  </code></pre>
  
  <p>So, when I click the "Delete" button, the app crashes with the following Log:</p>
  
  <pre><code>    *** Assertion failure in -[UITableView _endCellAnimationsWithContext:], /SourceCache/UIKit_Sim/UIKit-2872.3/UITableView.m:1254
      2013-08-13 18:39:17.624 RR_proto[1076:a0b] *** Terminating app due to uncaught exception
   'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of sections. 
   The number of sections contained in the table view after the update (1) must be equal 
  to the number of sections contained in the table view before the update (2), plus or minus
   the number of sections inserted or deleted (0 inserted, 0 deleted).'
      *** First throw call stack:
  </code></pre>
  
  <p>I also tried to add the following line after [self.managedObjectContext save:nil]:</p>
  
  <pre><code>[self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:YES];
  </code></pre>
  
  <p>But the app crashes like before.</p>
  
  <p>One more thing, everytime i start the app again after a crash through delete-action, the cell which should be deleted is really gone!</p>
  
  <p>Would be very nice, if somebody can help. 
  I know there are many questions about similar problems and I tried different things from these, without success. 
  Thanks!</p>