PDA

View Full Version : loading the navigation view




pamelaraj
May 29, 2009, 05:26 PM
I have a segment controller and when the user clicks the second segment, it should load the navigation controller. When I run the code, it doesn't show up anything..just a blank page. (Root view is the root view of my navigation controller)Here is the code.

if (segment == 1)
{
RootViewController *mySchedule = [[RootViewController alloc] initWithNibName:@"RootView" bundle:nil];
[self.navigationController pushViewController:mySchedule animated:YES];
[mySchedule release];
NSLog(@"segment index is %d",segment);
}

But if I add a "View" in the nib file (just for troubleshooting) and connect the FileOwners's view to this View and load that view in the program. Then, it loads it correctly when i click the second segment. I use this code.
[self.view insertSubview:mySchedule.view atIndex:0];


I don't want to have any "View" in the nib file, just load the navigation controller directly when the user selects the second segment. What I could be doing wrong?

Thanks in advance.