By updating the table, is there a difference, when i call let's say insertRowsAtIndexPaths more times, with an array of 1 object, comparing to calling it once, with an array of all objects?
This question also applies to reload, and delete, not just insert
This may look like a trivial question, but the update mechanism is quite complex, especially if you mix inserts, deletes, reloads and not sure if this can affect the animation
[self.tableView beginUpdates];
[self.tableView insertRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:1 inSection:sectionIndex]] withRowAnimation:UITableViewRowAnimationFade];
[self.tableView insertRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:2 inSection:sectionIndex]] withRowAnimation:UITableViewRowAnimationFade];
[self.tableView insertRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:3 inSection:sectionIndex]] withRowAnimation:UITableViewRowAnimationFade];
[self.tableView endUpdates];
Comparing to
[self.tableView insertRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:1 inSection:sectionIndex], [NSIndexPath indexPathForRow:2 inSection:sectionIndex], [NSIndexPath indexPathForRow:3 inSection:sectionIndex]] withRowAnimation:UITableViewRowAnimationFade];
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…