2009-08-12 73 views
0

我有这个错误,我不明白,它是让我的头受伤。所以,基本上,在我的iPhone应用程序中,我有UITabBar,每个标签中都有UINavigationControllers。Iphone应用程序崩溃时弹出到UITabBar标签的rootController

事情是这样的:

someViewController *someController = [[someViewController alloc] myInit]; 
    UINavigationController *someNav = [[UINavigationController alloc] initWithRootViewController:someController]; 
    tab = [[UITabBarController alloc] init]; 
    tab.viewControllers = [NSArray arrayWithObjects:otherNav, otherNav, evilNav, nil]; 
    [window addSubview:tab.view]; 

所以重现我的“珍贵”的错误我是这样的:

click evilNav tab 
-> push tableListView (category list) 
-> push otherTableListView (category items list) 
-> push someOtherView (single item) 
-> popToRoot || popToController withindex:0 || click on evilNav tab again || pop to otherTableListView -> pop to tableListView 
-> crash (with no notable error) 

所以,如果我走这么远来someOtherView我不能回去第一个tableListView(rootViewController)没有应用程序崩溃。同时,我可以转到其他选项卡,然后甚至在不崩溃的情况下单击evilNav(处于其他桌面视图或其他视图状态时)。

什么可能导致此问题? (如果您需要,我会发布更多代码)

回答

1

不能告诉你发布多一点的代码,但如果我不得不猜测,我会说你正在发布的东西,你不应该然后试图访问它是再次通常崩溃,没有错误。

+0

太感谢你了!评论发布的工作如同魅力,我的应用程序不再崩溃。不知道究竟是什么错误.. 再次感谢! – sniurkst 2009-08-13 18:45:43

1

我们需要查看推送和弹出的代码。这似乎是一个内存问题。你可能会在第一个viewcontroller弹出时释放,尽管你还没有完成它。