Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8743913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:45:37+00:00 2026-06-13T11:45:37+00:00

I have an application where the first view is a login screen, and the

  • 0

I have an application where the first view is a login screen, and the username and password is used for authentication all around the application. If something go wrong in the authentication process, the user will be thrown back to the login screen, but if the problem occurs when the user press the back button in the navigation bar, the application is showing the login screen correct, but the navigation bar will show the buttons from the view it was supposed to show.

Example: If a user press the back button on View B, and the application is supposed to show View A, but something went wrong, the application will show the login screen, but the navigation bar is the one from View A.

I have tried a couple of things, but the thing that came closest was:
In the ViewWillDisappear for View B:

        NSArray * nc = [self.navigationController viewControllers];
    [self.navigationController popToViewController:[nc objectAtIndex:0] animated:YES];

And it gave the result discribed above.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T11:45:38+00:00Added an answer on June 13, 2026 at 11:45 am

    In your LoginController override the viewWillAppear: methods and set the navigation bar button as you want :

    -(void) viewWillAppear:(BOOL) animated
    {
      [super viewWillAppear:animated];
    
      //Example :
      self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"AText" style:UIBarButtonItemStyleBordered target:self action:@selector(anAction)];
    }
    

    If you don’t use ARC remember to add autorelease to the leftBarButton Item :

    self.navigationItem.leftBarButtonItem = [[[UIBarButtonItem alloc] initWithTitle:@"AText" style:UIBarButtonItemStyleBordered target:self action:@selector(anAction)] autorelease];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a login screen in the first activity of my android application. When
In my Application first i have some Login View Controller,after login with button action
I have an application first showing a login screen which on a succesful login
I have application where i have two view controllers my first view and second
I have create a web application using CodeIgniter making at first a login interface.
I have an application containing a tab bar view and I have a login
Hi i have developed a login form (username,password and submit button) using a MySQL
My application is view based app. First view is login view. After login view
I am new to wpf and i am working on first application i have
I have a web application where the first request may take a few seconds

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.