Currently I do some work inside the didSelectRowAtIndexPath delegate and noticed that my row is still \"selected\" after I come back to the view controller later.
How ca
[tableView deselectRowAtIndexPath:indexPath animated:YES];
Typically, you want to deselect the row when the view controller appears again:
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
[self.tableView deselectRowAtIndexPath:[self.tableView indexPathForSelectedRow] animated:YES];
}
That's what UITableViewController
does implicitly, and animating the deselection process after the view controller appears again is a helpful hint to the user as to which cell they selected previously.