Mon application contient une vue tabulaire avec des lignes et des sections.
Lorsque je supprime le dernier élément d'une section, je supprime la section. Ça fonctionne bien. Mais, quand je déplace la dernière rangée d'une section dans une autre section, j'obtiens une erreur.Vue de table par défaut - suppression de sections
Voici mon code dans les deux cas:
[categoryArray removeObjectAtIndex:indexPath.section];
[tableView deleteSections:[NSIndexSet indexSetWithIndex:indexPath.section] withRowAnimation:UITableViewRowAnimationTop];
Voici l'erreur qui se produit dans moveRowAtIndexPath: fromIndexPath: toIndexPath:
2009-03-11 17:56:09.524 Test[5140:20b] 1
2009-03-11 17:56:09.525 Test[5140:20b] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSCFArray objectAtIndex:]: index (5) beyond bounds (5)'
Toute aide serait génial!
Comment avez-vous résolu ce problème? Je semble en avoir un similaire –