开发者

presentModalViewController: how to interact with parent

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开发者_如何学Python modal view. How can I interact with the "parent" to call him that he calls popToViewController?

Thanks a lot!


use property parentViewController in your modal vc and call [self.parentViewController dismissModalViewControllerAnimated: YES];


If you are asking how to dismiss the modal view controller, you'll want the modal view itself to call:

[self dismissModalViewControllerAnimated:YES];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜