Salut J'ai une vue de table, et quand je supprime une cellule je supprime un élément d'un NSMutableArray, l'archivage de ce tableau et la suppression de la cellule. Toutefois, lorsque je fais cela, le bouton de suppression est retardé après que je clique dessus. Est-ce qu'il y a un moyen de réparer ceci?iPhone/Obj-C - L'objet d'archivage provoque un décalage
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
if (editingStyle == UITableViewCellEditingStyleDelete) {
int row = [indexPath row];
[savedGames removeObjectAtIndex:row];
[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
//this line causing lag
[NSKeyedArchiver archiveRootObject:savedGames toFile:[self dataFilePath]];
}
}
Merci