Hi,
I have a navigation based iPhone app. Normally you start on the RootViewController, there you can select a row from an UITableView which brings you to another ViewController, let's call it SecondLevelViewController.
When the app is started I check if it was quit from SecondLevelViewController (via a parameter saved to the defaultUserSettings). If it was, I want to display that SecondLevelViewController again.
To achieve this I do the check in my application delegates
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
method, right after
[window addSubview:[navigationController view]];
[window makeKeyAndVisible];
Then I add the SecondLevelViewController to the view stack. I tried it with pushViewController and with setViewControllers:
SecondLevelViewController *newVC = [[SecondLevelViewController alloc] initWithNibName:@"SecondLevelView" bundle:nil];
[self.navigationController setViewControllers:[NSArray arrayWithObjects:[self.navigationController.viewControllers objectAtIndex:0], newVC, nil]
animated:YES];
The app then shows the desired view. Now the problem: the SecondLevelViewController displays a back button on the left side of the navigation bar. This button doesn't appear when using the way described above. My conclusion is, that the RootViewController isn't yet fully initialized at the time I go the the SecondLevelViewController. Is this possible? How can I avoid this?
Thanks, Mark.