Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial

Kalle Kod
37 PointsThe navigation bar disappears and don't understand where the rootview is
The problem I'm having is when I log out a user from the app, the navigation bar disappears and instead of showing up in the first tab bar as the user normally would do when signing in. The user instead shows up in the same tab as the log out button is placed(the third tab - the settings tab). It feels like that the app doesn't understand what the root view is(the first tab - the inbox tab) after signing out.
I want the user to show up in the first tab bar and not having to loose the navigation bar in the settings tab if the user log out and sign in again.
In the app I'm building I'm using a empty application with a Tab Bar Controller and a Navigation controller. The log out button is a button placed on a static cell in a table view
How can I fix this?
This is my code:
-
(IBAction)logOut:(id)sender { [PFUser logOut];
[self dismissViewControllerAnimated:YES completion:nil];
[self performSegueWithIdentifier:@"logOut" sender:self];
}
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if ([segue.identifier isEqualToString:@"logOut"]) { [segue.destinationViewController setHidesBottomBarWhenPushed:YES]; }
}
2 Answers

YOL O!
57 PointsHmmm..Feels like something fore Ben Jakuben Are you sure that segue is named correctly?

Ben Jakuben
Treehouse TeacherWhere does your logOut
segue take you? Perhaps you need to reset your tab bar controller to set the first tab as the active tab upon logging out?
[self.tabBarController setSelectedIndex:0];