ModalViewController在应用程序启动时转到后台

时间:2010-06-30 16:54:08

标签: iphone ios4

我正在将我的应用代码库迁移到iPhone SDK 4.在我使用的其中一个屏幕中

- (IBAction)LoadSearch {

MySearchViewController * mySearchController = [[MySearchViewController alloc] initWithNibName:@“MySearchViewController”bundle:nil];

[self.navigationController presentModalViewController:mySearchController animated:YES];

}

启动ModalViewController。当模态打开时,如果用户单击主页按钮,则应用程序将进入暂停状态。

如果我重新启动应用程序,在启动后立即将Modal变为不可见。看起来模态转到了navigationController视图的背景。当我将iphone旋转到横向模式时,我可以看到模态(模态正在适当地旋转)。

有没有人见过这个问题?任何建议都表示赞赏。

1 个答案:

答案 0 :(得分:0)

解决了这个问题我自己。

我在applicationDidBecomeActive中调用[window addSubview:tabBarController.view]。

因此,这导致将tabBarController.view添加到窗口,并且任何modalViewControllers都被推送到后台。