Erro ao excluir o item da tableview em swift

Estou tentando implementar uma funcionalidade de exclusão no meu aplicativo, permitindo que os usuários excluam as informações armazenadas nos dados principais e apresentadas por meio de uma exibição de tabela.

aqui está o meu código:

 func tableView(tableView: UITableView, commitEditingStyle editingStyle: UITableViewCellEditingStyle, forRowAtIndexPath indexPath: NSIndexPath) {
    if (editingStyle == .Delete){


    tableView.deleteRowsAtIndexPaths([indexPath], withRowAnimation: .Automatic) //error on this line

        }
}

o erro é o seguinte:

Assertion failure in -[UITableView _endCellAnimationsWithContext:], /SourceCache/UIKit_Sim/UIKit-3318.16.14/UITableView.m:1582
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of rows in section 0.  The number of rows contained in an existing section after the update (6) must be equal to the number of rows contained in that section before the update (6), 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).'


O que estou fazendo errado? Como corrijo esse erro?

questionAnswers(1)

yourAnswerToTheQuestion