1
votes

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 ?

2
Without a code sample we can't really say something...gcamp

2 Answers

0
votes

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.

0
votes

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