Table view cells do not lose highlight on touch up
cocoa-touch, objective-c, uitableview
Solution
Use the following where appropriate:
[tableView deselectRowAtIndexPath:indexPath animated:YES];
e.g. in `didSelectRowAtIndexPath`:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}
This will deselect the row at the specified index path.
You could also be interested in `clearsSelectionOnViewWillAppear` property in `UITableViewController`. If this property is set to yes then the controller clears the selection when the table appears. In default it set to YES.
Reference.
Problem
When I click a cell it selects, but it stays blue on touch up. I want the blue highlight to leave on touch up (but it's important that it highlights in the first place). This last answer in this post mentions something about `willSelectRowAtIndexPath:`, but I can't figure out how to use that to do what I want. Also, I do need `didSelectRowAtIndexPath:` to still be called, I just want the cell to unhighlight on touch-up.