I hope you can help as I'm a bit stuck as to where to look for a solution for this UITableView problem I'm having:
When I insert a new item at the top of a UITableView section using the following method (see code below) it all works beautifully apart from this glitch: The inserted row at the top of the section renders as expected - with rounded corners at the top left and right. The trouble is that the rows below are not visually updated i.e the second row/cell still has it's rounded corners whereas now it should be squared on it's top corners - please see this screen grab for clarification after the animation to insert a new row at the top of the second section has occurred. See the corners of the cells as they have not been updated.
// Amend the data source before updating the view to reflect the changes
[[self.playerData objectAtIndex: 0] removeObjectAtIndex: row];
[[self.playerData objectAtIndex: 1] insertObject:playerName atIndex:0];
// Amend the view to reflect changes
NSArray *deleteIndexPaths = [NSArray arrayWithObjects:
[NSIndexPath indexPathForRow:row inSection:0],
nil];
NSArray *insertIndexPaths = [NSArray arrayWithObjects:
[NSIndexPath indexPathForRow:0 inSection:1],
nil];
[self.playerTableView beginUpdates];
[self.playerTableView insertRowsAtIndexPaths:insertIndexPaths withRowAnimation: UITableViewRowAnimationLeft];
[self.playerTableView deleteRowsAtIndexPaths:deleteIndexPaths withRowAnimation: UITableViewRowAnimationLeft];
[self.playerTableView endUpdates];
Of course if I just sent the message: [self.playerTableView reloadData]; the view would appear correctly. However we really need this procedure to be animated to deliver a slick experience. Maybe if there was a delegated event that was fired on the completion of the insert animation I could update the view from thbe data source to get rid of the glitches, but I havn't found any hook like this.
Any help would be greatly appreciated.