in my UITableView sometimes cells stay selected after touching. Because it happens only occasionally, I\'m not able to reproduce the problem.
Any hints? Maybe it has
Just to expand on "Ed Marty"s answer, I chose to add the deselect in the "viewWillDisappear" method instead because I thought that it looked nicer.
In addition to this I was using a UITableView with a regular UIViewController (rather than a UITableViewController) so the tableView variable wasn't available to me. To overcome this I added a tableView property in my view controllers header file (and in my XIB file I connected the actual table view to the property)...
@property (nonatomic,retain) IBOutlet UITableView *tableView
...and in the view controllers implementation wired up the property and performed the deselect as follows..
@synthesize tableView
- (void) viewWillDisappear:(BOOL)animated {
[self.tableView deselectRowAtIndexPath:[self.tableView indexPathForSelectedRow] animated:animated];
[super viewWillDisappear:animated];
}