Iphone应用程序在弹出到UITabBar选项卡的rootController时崩溃

Iphone应用程序在弹出到UITabBar选项卡的rootController时崩溃,iphone,cocoa-touch,uikit,uitabbar,Iphone,Cocoa Touch,Uikit,Uitabbar,我有一个我不知道的错误,它让我的头受伤。所以,基本上,在我的iphone应用程序中,我有一个UtiAbar,其中有一些选项卡,每个选项卡内都有UINavigationController 大概是这样的: someViewController *someController = [[someViewController alloc] myInit]; UINavigationController *someNav = [[UINavigationController alloc]

我有一个我不知道的错误,它让我的头受伤。所以,基本上,在我的iphone应用程序中,我有一个UtiAbar,其中有一些选项卡,每个选项卡内都有UINavigationController

大概是这样的:

    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)
因此,为了复制我的“珍贵”bug,我如下所示:

    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)
所以,如果我转到其他视图,我无法返回到第一个tableListView(rootViewController),而不会导致应用程序崩溃。同时,我可以转到其他选项卡,甚至单击evilNav(当它处于otherTableListView或其他视图状态时),而不会崩溃


是什么导致了这个问题?(如果需要,我将发布更多代码)

我们需要查看推送和弹出的代码。但这似乎是一个记忆问题。当第一个viewcontroller弹出时,您可能正在释放它,即使您还没有使用完它。

如果您没有发布更多的代码,就无法真正判断了,但是如果我不得不猜测一下,我会说您正在发布一些不应该发布的内容,然后再次尝试访问它,它通常会无误地崩溃。

这可能是由于您声明私有成员的方式


我的答案实际上已经包含在我在这里发布的问题中:

非常感谢!评论发布效果很好,我的应用程序不再崩溃。不想弄清楚到底出了什么问题。。再次感谢!