views:

56

answers:

2

Hi,

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 ?

A: 

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

Jeff Kelley
A: 

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.

mahboudz