Reputation: 5238
I have a UITableView that in my cellForRowsAtIndexPath, I have this:
cell.selectionStyle = UITableViewCellSelectionStyleBlue;
However, after the action occurs in my UINavigationController and I go back, it's still selected. Also, I have a UIAlertView that pops up for one of my actions. How can I hide it after the user has finished tapping it.
Thanks
Upvotes: 0
Views: 111
Reputation: 6642
Override the delegate method like so:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}
Upvotes: 2
Reputation: 4388
You can do this:
[yourTableView deselectRowAtIndexPath:[yourTableView indexPathForSelectedRow] animated:NO];
Upvotes: 1