title: deleteRowsAtIndexPaths freezes the UITableView
body: <p>I've got an <code>UITableView</code> with Core Data. </p>
  
  <p>When I insert new records or update an existing record everything goes well and the <code>UITableView</code> updates automatically, but when I delete a record the <code>UITableView</code> freezes until the <code>UIView</code> is reloaded.</p>
  
  <p>Does anybody know what is going wrong?</p>
  
  <pre><code>- (void)controllerWillChangeContent:(NSFetchedResultsController *)controller
  {
      [self.tableView beginUpdates];
  }
  
  - (void)controller:(NSFetchedResultsController *)controller didChangeSection:(id &lt;NSFetchedResultsSectionInfo&gt;)sectionInfo
             atIndex:(NSUInteger)sectionIndex forChangeType:(NSFetchedResultsChangeType)type
  {
      switch(type) {
          case NSFetchedResultsChangeInsert:
              [self.tableView insertSections:[NSIndexSet indexSetWithIndex:sectionIndex] withRowAnimation:UITableViewRowAnimationFade];
              break;
  
          case NSFetchedResultsChangeDelete:
              [self.tableView deleteSections:[NSIndexSet indexSetWithIndex:sectionIndex] withRowAnimation:UITableViewRowAnimationFade];
              break;
      }
  }
  
  - (void)controller:(NSFetchedResultsController *)controller didChangeObject:(id)anObject
         atIndexPath:(NSIndexPath *)indexPath forChangeType:(NSFetchedResultsChangeType)type
        newIndexPath:(NSIndexPath *)newIndexPath
  {
      UITableView *tableView = self.tableView;
  
      switch(type) {
          case NSFetchedResultsChangeInsert:
              [tableView insertRowsAtIndexPaths:@[newIndexPath] withRowAnimation:UITableViewRowAnimationFade];
              break;
  
          case NSFetchedResultsChangeDelete:
              [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
              break;
  
          case NSFetchedResultsChangeUpdate:
              [tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
  
              break;
  
          case NSFetchedResultsChangeMove:
              [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
              [tableView insertRowsAtIndexPaths:@[newIndexPath] withRowAnimation:UITableViewRowAnimationFade];
              break;
      }
  }
  
  - (void)controllerDidChangeContent:(NSFetchedResultsController *)controller
  {
      [self.tableView endUpdates];
  }
  </code></pre>
  
  <p>The code where I delete a record and saves the context</p>
  
  <pre><code>- (void)refreshData
  {
      dispatch_queue_t fetchQ = dispatch_queue_create("Data Fetch", NULL);
      dispatch_async(fetchQ, ^{
  
          // here I delete some records            
  
          dispatch_async(dispatch_get_main_queue(), ^(void) {
              [self saveContext];
          });
      });
  }
  - (void)saveContext
  {
      NSError *error = nil;
      NSManagedObjectContext *managedObjectContext = self.managedObjectContext;
      if (managedObjectContext != nil) {
          if ([managedObjectContext hasChanges] &amp;&amp; ![managedObjectContext save:&amp;error]) {
               // Replace this implementation with code to handle the error appropriately.
               // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. 
              NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
              abort();
          } 
      }
  }
  </code></pre>