I have a table view, onclick of 7th row, I push another view. Then when I come back using pop, tableview is reloaded automatically in ios8. It does not happen is ios 7.
Problem is cellForRow and HeightForRow for 0,1,2,3 cell is not called. Hence table scrolls the 7th row up, and not visible. 9,10,11 cells are visible.
I want table to stay as it was when I come back to that view.
I saved selectedIndex and scrolled table to particular index in viewWillAppear.
[self.table_exhibitorProfile scrollToRowAtIndexPath:self.selectedIndexPath atScrollPosition:UITableViewScrollPositionNone animated:NO];
It shows 7th cell, but its position is not same as it was. It goes to top.
It shouldn't be reloading unless you tell it to. It's not automatically reloading in iOS 8 for me.
The only possibilities that I can come up with are that
you're using CoreData, an NSFetchedResutsController, and the same managedObjectContext in both view controllers. If something changes in the managedObjectContext in the second view controller, when you pop back, the fetchedResultsController will reload the table, or
you're calling
tableView.reloadData()
inviewWillAppear()
orviewDidAppear()
.I had the same problem and this is how I fixed it:
According to the Apple docs:
In my case I was setting the table view's
dataSource
to nil inviewWillDisappear:
and setting it back toself
inviewWillAppear:
thus causing the data to be reloaded.The 'automatic' reload went away when I moved the
dataSource
assignment toviewDidLoad
Hope this helps!