presentModalViewController问题-iphone sdk

presentModalViewController问题-iphone sdk,iphone,presentmodalviewcontroller,Iphone,Presentmodalviewcontroller,我使用的是没有tabbar控制器的自定义tabbar。当我尝试使用添加viewController时 [self presentModalViewController:controller animated:YES]; 编辑:更改为presentsModalViewController 它适用于MFMailComposeViewController,工作正常,但在我关闭它时,它也会删除选项卡栏 对于解决方案,我必须在appDelegate.viewController上显示控制器,如下所示:

我使用的是没有tabbar控制器的自定义tabbar。当我尝试使用添加viewController时

[self presentModalViewController:controller animated:YES];
编辑:更改为presentsModalViewController

它适用于MFMailComposeViewController,工作正常,但在我关闭它时,它也会删除选项卡栏

对于解决方案,我必须在appDelegate.viewController上显示控制器,如下所示:

[APPDELEGATE.navigationController presentModalViewController:controller animated:YES];
编辑:更改为presentsModalViewController

这可以很好地工作,并且不移除选项卡栏。但问题是当iphone闲置后被锁定时,我尝试使用以下方式呈现控制器:

[APPDELEGATE.navigationController presentModalViewController:controller animated:YES];
编辑:更改为presentsModalViewController

它不起作用。
在调试模式下,代码正在执行,但不显示viewController


非常感谢。

如果您正确复制了代码,则可以使用
[APPDELEGATE.viewController解除ModalViewController激活:是]
而不是

[APPDELEGATE.viewController PresentsModelViewController:YOURVIEWController动画:是]在第二次呼叫时

我已经自己修复了它。问题是我正在重新分配导航控制器

- (void)applicationDidBecomeActive:(UIApplication *)application
谢谢