title: iOS8 Swift: deleteRowsAtIndexPaths crashes
body: <p>I am having some trouble with deleting a row from my tableView in Swift, iOS 8, Xcode 6 Beta 6. Every time I try to delete a row I get an error along the lines of </p>
  
  <blockquote>
    <p>Assertion failure in -[UITableView _endCellAnimationsWithContext:],
    /SourceCache/UIKit_Sim/UIKit-3302.3.1/UITableView.m:1581 2014-08-30
    20:31:00.971 Class Directory[13290:3241692] *** 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 (25) must be
    equal to the number of rows contained in that section before the
    update (25), 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><em>I have read all the answers to this frequent problem, here, and feel I have fulfilled the conditions recommended.</em> The item <em>seems</em> to be removed from the data model -- when I reload the app, the deleted item is gone from the table -- but there seem to be some remnants in the appropriate sqlite file and of course the math doesn't add up. The println that spits out the indexPath shows the correct Section and Row. I'm very puzzled. This should be straightforward but I am missing something dumb I am sure, I suspect in the data model deletion. Full project on <a href="https://github.com/natebirkholz/NateBClassDirectory" rel="noreferrer">Github</a>.</p>
  
  <pre><code>func numberOfSectionsInTableView(tableView: UITableView!) -&gt; Int {
  
      return fetchedResultController.sections.count
  
  }
  
  
  func tableView(tableView: UITableView!, numberOfRowsInSection section: Int) -&gt; Int {
      return fetchedResultController.sections[section].numberOfObjects
  
      }
  
  func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -&gt; UITableViewCell! {
      let cell = tableViewMain.dequeueReusableCellWithIdentifier("CellMain", forIndexPath: indexPath) as UITableViewCell
  
          let personForRow = fetchedResultController.objectAtIndexPath(indexPath) as Person
          cell.textLabel.text = personForRow.fullName()
  
          return cell
  
  }
  
  func tableView(tableView: UITableView!, canEditRowAtIndexPath indexPath: NSIndexPath!) -&gt; Bool {
      return true
  }
  
  func tableView(tableView: UITableView!, editingStyleForRowAtIndexPath indexPath: NSIndexPath!) -&gt; UITableViewCellEditingStyle {
      return UITableViewCellEditingStyle.Delete
  }
  
   func tableView(tableView: UITableView!, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath!) {
      println("section and row \(indexPath.section) \(indexPath.row) ")
      if (editingStyle == UITableViewCellEditingStyle.Delete) {
      let personForRow : NSManagedObject = fetchedResultController.objectAtIndexPath(indexPath) as Person
      context?.deleteObject(personForRow)
      context?.save(nil)
          tableViewMain.beginUpdates()
      tableViewMain.deleteRowsAtIndexPaths([indexPath], withRowAnimation: UITableViewRowAnimation.Fade)
          tableViewMain.endUpdates()
      }
  </code></pre>