Mahmoud Fayez
Mahmoud Fayez

Reputation: 3459

UITableView disclosure button bug

When the user click on the disclosure button I perform a segue that push a new view

controller to the current navigation controller. the problem is when I pop the pushed

controller to get to the UITableView I found that the disclosure button is still in dark

blue!!! see attached image.

enter image description here

Upvotes: 0

Views: 155

Answers (2)

Nitin Gohel
Nitin Gohel

Reputation: 49730

have you tryig with this, hope it will helps you.

- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath {

[tableView reloadRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationNone];
[tableView selectRowAtIndexPath:indexPath animated:NO scrollPosition:UITableViewScrollPositionNone];

} 

Upvotes: 2

Richard Brown
Richard Brown

Reputation: 11436

That's because the cell is selected. The selected state is not cleared by default. Add to viewWillAppear method:

[self.tableView deselectRowAtIndexPath:[self.tableView indexPathForSelectedRow] animated:animated];

depending on what you named your tableView property.

Upvotes: 0

Related Questions