J'essaye de supprimer une cellule sur tableView
avec glisser mon doigt (comme sur l'appel récent). Je sais que je dois mettre en œuvre:Comment supprimer une cellule avec le doigt glissant sur l'iPhone
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
NSArray *index = [[NSArray alloc]initWithObjects:indexPath];
[self.tableView deleteRowsAtIndexPaths:index withRowAnimation: UITableViewRowAnimationNone];
}
Mais quand je glisse le doigt, je reçois à cette fonction et dans la deuxième rangée quand je suis en train de supprimer la cellule une erreur get:
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 (4) must be equal to the number of rows contained in that section before the update (4), plus or minus the number of rows inserted or deleted from that section (0 inserted, 1 deleted).
Quelqu'un peut-il aider?