iOS UITableView "'Attempt to create two animations for cell'" iOS UITableView "'Attempt to create two animations for cell'" ios ios

iOS UITableView "'Attempt to create two animations for cell'"


To anybody that encounters this situation again, make sure there are not repeated indexPaths in the array being passed to reload, delete or insertRowsAtIndexPaths.


It’s hard to understand how you’re causing that error message, but try moving your table reload code into a separate method, and call that where you have the two identical code blocks now. That might fix what seems to be some sort of weird race condition that UITableView is supposed to filter out on its own anyway.


Assume self.arTableData is a mutable array of table & tableView is an instance of UITableView. Assume there are 10 rows ( which means 10 objects in array ) in tableView.I do implement following code to remove rows animated.

int i; // to remove from 3 to 6for(i=2;i<6;i++){    [self.arTableData removeObjectAtIndex:i];    [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:i inSection:0]] withRowAnimation:UITableViewRowAnimationRight];}

If you want multiple row deletion, try to remove rows one by one & not all at once. Deletion of multiple rows ( including animation ) might cause crash.

But while you are inserting rows, you can pass entire array to insert & UITableView will surely perform animation.

That trick works for me without any hassles. Hope it work same for you. Best of luck.


matomo