I've been having the same problem. It appears that the code you mention can be simplified to not even check if there is a current selected row:
- (void) viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self.tableView deselectRowAtIndexPath:[self.tableView indexPathForSelectedRow] animated:YES];
}
However I noticed that even setting animated to YES does not give the same animation with the pan back gesture as with pressing the back button.
I see that JosephH mentions in this question:
ios7 new pan gesture to go back in navigation stack does not clear tableview selection
that some of these back glitches may be getting fixed (in 7.04), but I'm still seeing the problem and I'm running 7.04. Hopefully in 7.1?
The "Clear on Appearance" attribute of the UITableViewController is supposed to clear the previously selected cell when segueing back to the TableView, but clearly this is not happening when the pan back gesture is done quickly.