title: TableView row removal with NSFetchedResultsController crashing?
body: <p>I'm trying to let users delete a row from a <code>UITableView</code> that's populated using a <code>NSFetchedResultsController</code> but keep getting a fatal error:</p>
  
  <blockquote>
    <p>Terminating app due to uncaught exception
    'NSInternalInconsistencyException', reason: 'Invalid update: invalid
    number of rows in section 1.  The number of rows contained in an
    existing section after the update (7) must be equal to the number of
    rows contained in that section before the update (7), 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>I'm deleting the core data entry and then deleting the row in the tableView in my code but still get the error above:</p>
  
  <pre><code>func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) {
      if editingStyle == .delete {
          self.feedTable.beginUpdates()
          let event = self.fetchedResultsController.object(at: indexPath) as Event
          self.managedObjectContext.delete(self.fetchedResultsController.object(at: indexPath))
          do {
              try self.managedObjectContext.save()
          } catch {}
          self.feedTable.deleteRows(at: [indexPath], with: .automatic)
          self.feedTable.endUpdates()
      }
  }
  </code></pre>
  
  <p>Can anybody help understand what I'm doing wrong?</p>