3

I have a navigation view controller and I am using popViewControllerAnimated(true) to show the view controller shown before. It works but I need to call the viewDidLoad of the before shown view controller to reload a table view. The viewDidLoad is not called when using popViewControllerAnimated(true). What should I do to call it then.

UditS
  • 1,936
  • 17
  • 37
Lenny1357
  • 748
  • 1
  • 13
  • 21
  • 1
    Perhaps you should be looking at viewDidAppear or viewWillAppear? viewDidLoad was likely called much earlier than you are expecting. – David Hoelzer Feb 06 '16 at 20:22

1 Answers1

7

You can use the viewDidAppear or viewWillAppear methods in view lifecycle to reload the data in your tableview.

mohonish
  • 1,396
  • 1
  • 9
  • 21
  • Which are the differences between these two methods? – Lenny1357 Feb 08 '16 at 13:50
  • 3
    `viewWillAppear` is called just before the view is about the be rendered on screen. `viewDidAppear` is called after the view has already been rendered on screen. – mohonish Feb 09 '16 at 04:46