Nested modal view controller gives strange message under iOS6?
Posted
by
user1840362
on Stack Overflow
See other posts from Stack Overflow
or by user1840362
Published on 2012-11-20T23:03:03Z
Indexed on
2012/12/08
5:04 UTC
Read the original article
Hit count: 132
ios6
|presentmodalviewcontrolle
I am presenting a modal view controller from another modal view controller, and this worked fine under all iOS versions prior to iOS6. But under iOS6 I am getting the following warning message in the emulator:
Warning: Attempt to present <UINavigationController: 0x14e93680> on <UINavigationController: 0x9fc6b70> while a presentation is in progress!
The modal view controller is not shown if this warning appears. Basically I am using code like this to show the modal view controller:
WebAuthViewController *authController = [[WebAuthViewController alloc] initWithNibName:nil bundle:nil];
authController.challenge = challenge;
authController.delegate = self;
UINavigationController *aNavController = [[UINavigationController alloc] initWithRootViewController:authController];
[self presentModalViewController:aNavController animated:YES];
[aNavController release];
[authController release];
The view that is already shown is a UIWebView also shown in a modal view, like this:
WebViewController *addController = [[WebViewController alloc] initWithNibName:nil bundle:nil];
addController.urlToLoad = [NSURL URLWithString:urlString];
addController.delegate = self;
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:addController];
navigationController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:navigationController animated:YES];
[navigationController release];
[addController release];
The apple docs still suggest that one is supposed to be able to stack navigation controllers like this, so I am at a loss to explain why this happens. Any hints?
© Stack Overflow or respective owner