2009-08-12 66 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彈出時釋放,儘管你還沒有完成它。