Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tableview row stays selected after coming back from push segue

Tags:

iphone

segue

My view controller is an UIViewController. I've added UITableView to the UIView. When the tableview row is selected, a push segue fires a new view controller. However, when coming back from the new view controller, the selected row stays selected. I didn't have this problem when my first controller was an UITableviewController, but I had to change it to an UIViewController, because I wanted to add activity indicator to my view. The other thing I noticed is that when my first controller was a UITableviewController, viewDidLoad wasn't called when coming back from the new view controller (but now it's called).

like image 535
Shiim Avatar asked Nov 29 '22 01:11

Shiim


1 Answers

Add...

[tableView deselectRowAtIndexPath:indexPath animated:YES];

in tableView:didSelectRowAtIndexPath:

like image 90
Atif Azad Avatar answered Dec 09 '22 16:12

Atif Azad