3

I am new iPhone developer. I have created an application in which I use pushViewController to navigate between views. But when I call :

DetailViewController *dvController = [[DetailViewController alloc] init];
[self.navigationController pushViewController:dvController animated:YES];

then the viewDidLoad method of DetailViewController is called. And then I can navigate the screen.

But I want to navigate first and then the have the viewDidLoad method be called. How can I do this ?

Oliver
  • 23,072
  • 33
  • 138
  • 230

1 Answers1

0

You can't. The nib/xib is loaded before the controller is pushed onto the navigation stack. Can't you move the viewDidLoad code to viewDidAppear or something like that?

Oliver
  • 23,072
  • 33
  • 138
  • 230
Marcelo Alves
  • 1,856
  • 11
  • 12