Problem with navigation between IOS screens

1

containing tabbarItem where each has a UINavigationViewController responsible for browsing between screens, but UITabbarController is like rootViewController so I can even navigate between screens but using only the navigationBar when clicking on some tabbarItem the app simply stops and I can not but navigate between the screens this also happens with UITableView , would anyone have the solution?

The AppDelegate startup function follows:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
self.tabBarController = [[UITabBarController alloc] init];

Cardapio* vc1 = [[Cardapio alloc] init];
Carrinho* vc2 = [[Carrinho alloc] init];
Configuracao* vc3 = [[Configuracao alloc] init];
ViewController* viewcontroller = [[ViewController alloc] init];
Menu* menu = [[Menu alloc] init];

UINavigationController *frontNavigationController = [[UINavigationController alloc] initWithRootViewController:viewcontroller];



UINavigationController *rearNavigationController = [[UINavigationController alloc] initWithRootViewController:menu];

SWRevealViewController *mainRevealController = [[SWRevealViewController alloc]
                                                initWithRearViewController:rearNavigationController frontViewController:frontNavigationController];

vc1.title = @"Cardápio";
vc2.title = @"Carrinho";
vc3.title = @"Configuração";
mainRevealController.title=@"Principal";

vc2.tabBarItem.badgeValue=@"0";


vc1.tabBarItem.image = [UIImage imageNamed:@"ico1"];
vc2.tabBarItem.image = [UIImage imageNamed:@"ico2"];
vc3.tabBarItem.image = [UIImage imageNamed:@"ico3"];
mainRevealController.tabBarItem.image = [UIImage imageNamed:@"ico4"];


UINavigationController* n1 = [[UINavigationController alloc] initWithRootViewController:vc1];
UINavigationController* n2 = [[UINavigationController alloc] initWithRootViewController:vc2];
UINavigationController* n3 = [[UINavigationController alloc] initWithRootViewController:vc3];

NSArray *controllers = [NSArray arrayWithObjects:mainRevealController, n1,n2,n3, nil];

_tabBarController.viewControllers = controllers;
_tabBarController.delegate=self;

window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
window.rootViewController = _tabBarController;
[window makeKeyAndVisible];

return YES;

}

    
asked by anonymous 25.05.2015 / 22:13

0 answers