UITabBarController e UINavigationController personalizados
Estou desenvolvendo um aplicativo para iOS5 e acima e não uso storyboards ou IB. Estou criando um costumeUITabBarController
e no meuAppDelegate
Eu estou colocando nele 4 controladores de visualização com apenas 1UINavigationController
(não posso dizer porque).
Isso resulta em um comportamento em que eu posso empurrar o novo VC somente a partir doprimeiro guia, que é, aparentemente, embalado em umUINavigationController
chamadonavController
:
SGTabBarController *tabBarController = [[SGTabBarController alloc] init];
SGHomeViewController* vc1 = [[SGHomeViewController alloc] init];
SGChooseOSAgainViewController* vc3 = [[SGChooseOSAgainViewController alloc] init];
SGSmsServicesViewController* vc4 = [[SGSmsServicesViewController alloc] init];
SGSupportViewController *vc5 = [[SGSupportViewController alloc] init];
navController = [[UINavigationController alloc] initWithRootViewController:vc1];
NSArray* controllers = [NSArray arrayWithObjects:navController, vc3, vc4, vc5, nil];
tabBarController.viewControllers = controllers;
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.rootViewController = tabBarController;
[navController setNavigationBarHidden:YES animated:NO];
[self.window makeKeyAndVisible];
Por que é que? Devo criar um separadoUINavigationController
para cada aba? Eu peguei esse código da documentação da Apple.