小编CrE*_*EaK的帖子

在appdelegate中呈现多个模态视图

我想在应用程序收到的每个推送消息之后呈现一个modalviewcontroller:"应用程序:(UIApplication*)应用程序didReceiveRemoteNotification:(NSDictionary*)userInfo"

我像这样呈现viewcontroller:

ReleaseViewController *viewController = [[ReleaseViewController alloc] init];
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:viewController];
[self.window.rootViewController presentModalViewController:navController animated:YES];
Run Code Online (Sandbox Code Playgroud)

所以当另一个推送消息到来并且旧的ModalViewController仍然是可见的时,我想在旧的上呈现一个新的modalviewcontroller.但它不起作用.没有发生任何事情,控制台只是说(我认为这是iOS 6 Beta的调试消息):

Warning: Attempt to present <UINavigationController: 0x1dde6c30> on <UINavigationController: 0x1dd73c00> whose view is not in the window hierarchy!
Run Code Online (Sandbox Code Playgroud)

我究竟做错了什么?

PS:我不想解雇旧的ViewController,我希望它们能够堆叠.

谢谢!

iphone uiapplicationdelegate modalviewcontroller

6
推荐指数
1
解决办法
5842
查看次数