我目前正在为我的公司开发iPhone应用程序,我遇到了一个奇怪的事情。presentModalViewController - ViewController自动消失后呈现
我查看数字体系是这样的:
包含5个选项卡包含一个UINavigationController每个标签的UITabBarController。 到目前为止,一切都很完美。
现在我想使用的代码此线对 的UITabBarController经由presentModalViewController方法呈现模态的视图控制器:
-(void)callFilterOptions
{
FilterOptionsView *filterView = [[FilterOptionsView alloc] init];
[filterView setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];
[self.tabBarController presentModalViewController:filterView animated:TRUE];
}
的FilterOptionsView是含有只不过是一个黑色背景在 时刻正常的UIViewController 。
会发生什么情况是视图呈现,几秒钟后神秘消失。 这是怎么回事?在没有点我打电话dismissModalViewController方法。
我在展示mailcomposer时已经遇到了这个问题。
问候, 弗洛里安
尝试更改self.tabBarController for [self.view presentModalViewController:filterView animated:TRUE]; – oriolpons 2012-02-08 15:07:49
发生同样的错误。我无法从视图中呈现模式视图控制器,所以我尝试[self presentModalViewController:filterView animated:TRUE]; – user1197467 2012-02-08 15:12:38
你使用ARC吗?尝试使您的filterView作为类变量 – Chakalaka 2012-02-08 15:22:11