title: Swipe to Delete a Cell in a Table using NSFetchedResultsController
body: <p>I had previously a working implementation where I had a single TableViewController, I press the ADD button, it brings up another view controller which lets the user add text to fields - that in turn adds that information over to the entities and attributes and I could display that in the Table View. Implementing the following methods, I could swipe to delete a row successfully:</p>
  
  <pre><code>- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
  {
      return YES;
  }
  
  - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
  {
  
      if (editingStyle == UITableViewCellEditingStyleDelete)
      {
          [self.managedObjectContext deleteObject:[self.transactions objectAtIndex:indexPath.row]];
          [self.transactions removeObjectAtIndex:indexPath.row];
          [self.tableView reloadData];
  
          NSError *error = nil;
          if (![self.managedObjectContext save:&amp;error])
          {
              NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
              abort();
              [self.tableView reloadData];
          }
      }
  
  }
  </code></pre>
  
  <p>Now, I've managed to successfully implement the NSFetchedResultsController to allow the same functionality with the adding and fetching of information, but just more secure. What I cannot figure out now is how to actually implement the same swipe to delete functionality. </p>
  
  <p>I added the:</p>
  
  <pre><code>- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
  {
      return YES;
  }
  </code></pre>
  
  <p>I added this and the "swipe" gesture just doesn't work to delete cells. </p>
  
  <p>In the NSFetchedReusltsController code for the datasource, I have:</p>
  
  <pre><code>- (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:[NSArray arrayWithObject:newIndexPath] withRowAnimation:UITableViewRowAnimationFade];
              break;
  
          case NSFetchedResultsChangeDelete:
              [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
              break;
  
          case NSFetchedResultsChangeUpdate:
              [self configureCell:[tableView cellForRowAtIndexPath:indexPath] atIndexPath:indexPath];
              break;
  
          case NSFetchedResultsChangeMove:
              [tableView deleteRowsAtIndexPaths:[NSArray
                                                 arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
              [tableView insertRowsAtIndexPaths:[NSArray
                                                 arrayWithObject:newIndexPath] withRowAnimation:UITableViewRowAnimationFade];
              break;
      }
  }
  </code></pre>
  
  <p>along with all of the required methods, but the swipe to delete action is just not working. </p>
  
  <p>Any thoughts with this would be massively helpful. </p>