Problem with navigation between IOS screens

Asked

Viewed 150 times

1

Could someone help me solve a problem, where I use a drop-down menu Swrevealviewcontroller in my IOS project using the language objective-c, in my app I have a Uitabbarcontroller containing 4 tablet where each has a Uinavigationviewcontroller responsible for navigating between the screens , but the Uitabbarcontroller is as rootViewController then I can even navigate between the screens but using only the navigationBar by clicking on any tablet the app simply stops and can’t but navigate between the screens this also occurs with Uitableview, someone would have the solution?

Follow the Appdelegate startup function:

- (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;

}

  • Any error messages on the console? Try to isolate the problem by removing as much code as possible so that the problem still occurs and post the resulting code.

  • App stops in what sense? It shows nothing? It’s error? It closes your app? Can you drill a little deeper into the fault please?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.