I am presenting a navigation controller with a view controller initialized as its root using presentModalViewController
. However, when I push another view controller onto this new navigation stack, the back button needs to be pushed twice to return to the original view presented modally. Any idea why this would occur? Is it possible that the new view controller is being pushed onto the original navigation controller and then the navigation controller in the modal view controller as well?
My code in the original navigation controller:
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:addViewController];
[self.navigationController presentModalViewController:navController animated:YES];
[addViewController release];
[navController release];
And then my code inside the modal view:
PriorityViewController *priorityView = [[PriorityViewController alloc] initWithNibName:@"PriorityView" bundle:nil];
priorityView.taskInfo = self.taskInfo;
priorityView.isAdding = YES;
[self.navigationController pushViewController:priorityView animated:YES];
[priorityView release];