Reputation: 11148
Showing a modal ViewController works fine:
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:myView];
[self.navigationController presentModalViewController:navController animated:YES];
[navController release];
In my modal view, I have a navigation button to switch back to the mainmenu. Normally a would call [self.navigationController popToViewController:delegate.viewMainmenu animated:YES];
but thats not possible inside the modal view. How can I interact with the "parent" to call him that he calls popToViewController
?
Thanks a lot!
Upvotes: 2
Views: 4103
Reputation: 3895
If you are asking how to dismiss the modal view controller, you'll want the modal view itself to call:
[self dismissModalViewControllerAnimated:YES];
Upvotes: 0
Reputation: 16719
use property parentViewController in your modal vc and call [self.parentViewController dismissModalViewControllerAnimated: YES];
Upvotes: 4