0

I would like to reload my table view if the user comes only from the child view (e.g. if he clicks on a certain cell and then returns by clicking on the back button). I want to use the standard back button which got created automatically by the NavigationController.

Is there any event which is called when the user returns from a certain child view?

GoodSp33d
  • 6,252
  • 4
  • 35
  • 67
andreaspfr
  • 2,298
  • 5
  • 42
  • 51

2 Answers2

0

Please do that you whats in because It's work on view appearing.

How to Pass information Back in iOS May be Its helpfull..

Community
  • 1
  • 1
Jogendra.Com
  • 6,394
  • 2
  • 28
  • 35
  • 1
    I only want to reload the table view if it the user navigates from a child view. With this solution my tableview would load every time (doesn't matter from which view it gets loaded) – andreaspfr Jun 12 '14 at 12:41
  • @seven-ply Follow that link in Joge's answer and create a protocol to pass information back... – GoodSp33d Jun 12 '14 at 14:38
0

Sure. Just create a protocol in your child view controller that contains a method you can call when the user hits the back button in the child view controller. Then, you can specify that your view controller that contains your table conforms to this protocol, and set this class as the delegate when you push to the child.

Then in the child view controller's viewWillDisappear: method, you can call the delegate method to let your table view know it should reload. This way, the table can be reloaded when the user is returning from the child view controller, and not every time the main view controller appears.

Mick MacCallum
  • 129,200
  • 40
  • 280
  • 281