I have UITableView which uses custom UITableViewCells. The cells can have one of three types of background images (set in each cell\'s .backgrou
(this solution only works for the reordering of rows within the same section. It'll fail when dragging and dropping rows to a different section)
I had the same problem when updating a cell's detail label text after being reordered.
I solved it with the following code:
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
{
UITableViewCell* cell = [self.table cellForRowAtIndexPath:fromIndexPath];
cell.detailTextLabel.text = @"NEW STRING";
}
Note that you have to update the cell at fromIndexPath, because it seems that the internal state of the tableview doesn't update until this method returns. If you get the cell at toIndexPath, after reordering finishes, you will see the neighbor cell gets updated. (either top or bottom one).