1

I am creating a UIViewController using the nib file ?

I have implemented the following 2 methods

  • (void)viewDidAppear:(BOOL)animated
  • (void)viewWillAppear:(BOOL)animated

in my view controller, but these methods are not getting called every time ?

What is the error in the code ?

Halle
  • 3,584
  • 1
  • 37
  • 53
Biranchi
  • 16,120
  • 23
  • 124
  • 161

2 Answers2

0

When initializing from a nib, you can use the awakeFromNib method.

Jeff Kelley
  • 19,021
  • 6
  • 70
  • 80
0

Depending on how you load your viewController, your

(void)viewDidAppear:(BOOL)animated
(void)viewWillAppear:(BOOL)animated

will not get called.

Here is one way I load viewcontrollers. As you see, I explicitly call viewDidAppear, viewDidDisappear, etc. myself.

Community
  • 1
  • 1
mahboudz
  • 39,196
  • 16
  • 97
  • 124