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 8514875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T04:59:23+00:00 2026-06-11T04:59:23+00:00

I’m working on an iOS 5 application that first presents the user with a

  • 0

I’m working on an iOS 5 application that first presents the user with a Login Window. Upon successful login, a Modal Segue is performed that presents a UINavigationController which contains the bulk of the actual app. Now many things can happen from this point on, but what I’m interested in is when the user decides to log out.

I would like to return to the first view, the Login window, but I can’t seem to pop the Navigation Controller and return to the first view.

As a visualization:

                                             (NavigationController)
[UserLoginViewController] --modal segue-> [UserMenuTableViewController] --push segue--> [otherviews, etc]
     ^                                                  |
     |                                             modal segue
     |                                                  |
     |                                                  v
     ^                                    [UserDashBoardViewController]
     |                                                  |
     |                                           (logout pressed)
     |                                                  |
      -<---------------pop back to login--------------<-

I’ve tried delegation, to notify the initial login view that it’s time to dismiss the Navigation Controller that was presented modally, but I get the error:

2012-09-10 11:13:05.749 KITxWebMobileJSONv4[1138:f803] attempt to dismiss modal view controller whose view does not currently appear. self = <UINavigationController: 0x68c6150> modalViewController = <UserDashboardViewController: 0x68d9fb0>
2012-09-10 11:13:05.749 KITxWebMobileJSONv4[1138:f803] attempt to dismiss modal view controller whose view does not currently appear. self = <UserLoginViewController: 0x688ffa0> modalViewController = <UINavigationController: 0x68c6150>

The Login View delegation looks like this:

// This method is called from the UserMenuTableViewController, when it's time to log out:
- (void)userMenuTableViewController:(UserMenuTableViewController *)sender
                          loggedOut:(BOOL)didLogOut
{
    if (didLogOut) {
        /* delete user info and take care of data on backend:
         * ...
         */

        // pop navigation controller, presenting the initial Login View:
        [self dismissModalViewControllerAnimated:YES];  // THIS LINE FIRES AND GETS THE ERROR ABOVE
    }
}


- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    if ([segue.identifier isEqualToString:@"Login Success"]) {  // successful login:

        // set (UINavigationController *)self.nav to the segue destination (for a handle, if needed):
        self.nav = (UINavigationController *)segue.destinationViewController;

        // grab the user menu and set self to be it's delegate:
        UserMenuTableViewController *userMenu = [self.nav.viewControllers lastObject];
        userMenu.delegate = self;
    }
}

Thanks in advance!

  • 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-11T04:59:24+00:00Added an answer on June 11, 2026 at 4:59 am

    In viewController which appears after you called your NavigationController, call this

    [self dismissViewControllerAnimated:YES completion:nil];
    

    where you want to pop your navigationController. This worked for me.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I am doing a simple coin flipping experiment for class that involves flipping a
We're building an app, our first using Rails 3, and we're having to build
I know there's a lot of other questions out there that deal with this

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.