使用tabBarController構建應用程序時出現問題。 如果我從AppDelegate構建它,使用navigationController做tabBarController沒有問題。如何在viewController推送操作後在新視圖上管理TabBarController
但現在我所經歷過的問題時,我想創建一個新的tabBarController視圖(3個標籤,每個人都有導航控制器)從以前的導航控制器推後。 它根本不起作用。
下面是代碼:
MainViewController *mainViewController = [[MainViewController alloc] initWithNibName:@"MainView_iPhone" bundle:nil];
mainViewController.tabBarItem.title = @"First";
UINavigationController *mainNavigationController = [[UINavigationController alloc] initWithRootViewController:mainViewController];
DictionariesViewController *dictionariesViewController = [[DictionariesViewController alloc] initWithNibName:@"DictionariesView_iPhone" bundle:nil];
dictionariesViewController.tabBarItem.title = @"Second";
UINavigationController *dictionariesNavigationController = [[UINavigationController alloc] initWithRootViewController:dictionariesViewController];
tabBarController = [[UITabBarController alloc] init];
tabBarController.viewControllers = [NSArray arrayWithObjects:mainNavigationController, dictionariesNavigationController, nil];
[self.navigationController pushViewController:tabBarController animated:YES];
有後視圖是僕射「第一」控制器的問題。應用程序崩潰...
請求幫助。
問候 博魯特
請重新格式化您的代碼。這是很難閱讀的代碼是:) – ryanprayogo 2010-07-06 19:30:48