NSIndexPath* updatedPath = [NSIndexPath indexPathForRow: 0 inSection: 0];
NSIndexPath* updatedPath2 = [NSIndexPath indexPathForRow: 1 inSection: 0];
NSArray* updatedPaths = [NSArray arrayWithObjects:updatedPath, updatedPath2, nil];
[self.mySexyTableView reloadRowsAtIndexPaths:updatedPaths withRowAnimation:UITableViewRowAnimationTop];
Le code ci-dessus fonctionne et il anime. Le problème est que j'ai beaucoup de données et je ne veux pas coder en dur les index de ligne. Puisque j'ai seulement une section dans ma section de table peut être 0. Comment est-ce que je peux générer dynamiquement NSArray des objets NSIndexPath?UITableView Animation Headache
Ou existe-t-il un moyen plus simple d'animer la vue tabulaire. Toutes les lignes dans ma vue de table changent lorsque l'utilisateur clique sur l'onglet en haut de la vue de table.
reloadData n'anime pas. – bparanj
Quand je lance votre code, j'obtiens ceci: *** échec Assertion en - [_ UITableViewUpdateSupport _setupAnimationsForNewlyInsertedCells], /SourceCache/UIKit/UIKit-963.10/UITableViewSupport.m:541 2009-07-08 09: 14: 42,979 QuartzFun [3781: 207] *** Application terminante due à une exception non interceptée 'NSInternalInconsistencyException', raison: 'Tentative de création de deux animations pour la cellule' 2009-07-08 09:14:42.979 QuartzFun [3781: 207] Stack: ( – bparanj
Si la boucle I: NSMutableArray * updatedPaths = [[NSMutableArray alloc] init]; \t \t \t for (int i = 0; i <[lowlist compte]; i ++) { NSIndexPath * updatedPath = [NSIndexPath indexPathForRow: i insection: 0]; [updatedPaths addObject: updatedPath]; \t \t \t} \t \t \t [self.mySexyTableView reloadRowsAtIndexPaths: updatedPaths withRowAnimation: UITableViewRowAnimationTop]; je reçois: *** Terminaison de l'application due à l'exception non interceptée 'NSRangeException', raison: '*** - [NSMutableIndexSet addIndexesInRange:]: Plage {214747, 1} dépasse la valeur d'index maximale de NSNotFound - 1' QuartzFun [3810: 207] – bparanj