I´m going through Apple´s Your First iPhone OS Application tutorial. I´m stuck in the Adding a View Controller Part.
There´s the part that mentions "To make sure you’re still on track, confirm that your HelloWorldAppDelegate class implementation (HelloWorldAppDelegate.m) looks like this:". What follows is a source listing which I´m trying to compile and run.
If i get rid of the line that says [window addSubview:controllersView]; it works. On the other hand If I leave the line i cant get to the white screen when the iphone simulator launches:
- (void)applicationDidFinishLaunching:(UIApplication *)application {
MyViewController *aViewController = [[MyViewController alloc]
initWithNibName:@"MyViewController" bundle:[NSBundle mainBundle]];
[self setMyViewController:aViewController];
[aViewController release];
UIView *controllersView = [myViewController view];
[window addSubview:controllersView];
[window makeKeyAndVisible];
}
Why is that?