I’m doing the fourth assignment on the Stanford Iphone Dev Course.
- (void)applicationDidFinishLaunching:(UIApplication *)application {
// Override point for customization after application launch
[window addSubview:[navigationController view]];
[window makeKeyAndVisible];
ListViewController *listview = [[ListViewController alloc] initWithNibName:@"ListView" bundle:[NSBundle mainBundle]];
[[self navigationController] pushViewController:listview animated:NO];
[listview release];
}
So, i’m trying to get my get my listview inside of the navigationcontrollers view. but the thing that happens is that the listview gets a new view with a “back to rootcontroller” button in the navigation bar. and when i click it i get back to the navigationcontroller view that is empty.
what am i doing wrong?
if you want your ListViewController to be rootViewController, you should do smth like this
instead of
pushViewController. pushViewController just add your listView to the top of the controller’s stack. initial viewController stays with an empty view.