I have a view based application. I am trying to load a second custom view controller when the app starts. I have the following code :
- (void)viewDidLoad
{
controller = [NewController alloc];
[self presentModalViewController:controller animated:YES];
[controller release];
[super viewDidLoad];
}
The problem is that the new view controller is not loading and viewDidLoad is not called. I have no xib file for the second view controller.
Can anyone help ?
It won’t work in your viewDidLoad or viewWillAppear methods. Use
viewDidAppearinstead.