I have an app that I migrated over from iOS 5 to iOS 6 and am having trouble with the UINavigationController not displaying correctly.
In my app, the user must login and they are presented that login screen in a modal view after pressing a button.
WelcomeViewController.m
- (IBAction)signInButtonSelected:(id)sender
{
LoginViewController *loginViewController = [[LoginViewController alloc] initWithNibName:nil bundle:nil];
[self.navigationController presentViewController:loginViewController animated:YES completion:^{}];
}
The view loads correctly and has lets the user enter their login credentials. However, when they press the login button, the next view is presented and it SHOULD have a UINavigationBar at the top, except it doesn’t. If I quit the app and restart it, the UINavigationBar shows up in that view properly. I have not a clue as to why going from the login view to the logged in screen hides the navigation controller.
Here is the code that is executed when the login button is pressed that loads the next view:
LoginViewController.m
WallViewController *wallViewController = [[WallViewController alloc] initWithNibName:nil bundle:nil];
[(UINavigationController *)self.presentingViewController pushViewController:wallViewController animated:YES];
[self.presentingViewController dismissViewControllerAnimated:YES completion:nil];
If anyone can shed some light on to why this is happening that would be great!
Thanks!
Figured it out. In my App Delegate, I had placed:
And it would hide the navigation bar after a user would login. Not exactly sure why this in the app delegate would affect a view later on down the line. But once it was removed, it works perfectly!
Thanks for the help!