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

  • SEARCH
  • Home
  • 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 6144143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:36:39+00:00 2026-05-23T18:36:39+00:00

I have a project with a NavigationController, that contains into IB the first ViewController

  • 0

I have a project with a NavigationController, that contains into IB the first ViewController to show. That’s just the default pattern when creating the project.

In that first viewController, I receive some event that I send to the appDelegate, and I want it to replace that rootview with another one. Not going to a next one.

So I do :

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{   
    // Override point for customization after application launch.
    // Add the navigation controller's view to the window and display.
    self.window.rootViewController = self.navigationController;
    [self.window makeKeyAndVisible];
    return YES;
}

- (void) goNext {

    [self.navigationController popViewControllerAnimated:NO];

    NextViewController* nextWindow = [[[NextViewController alloc] initWithNibName:@"NextView" bundle:nil] autorelease];
    [self.navigationController pushViewController:nextWindow animated:NO];
}

But that doesn’t work, the first viewcontroller is not poped.
And the second one is logically displayed with a back button.

I just want to replace that first view with the other one as the start of the navigation process.

  • 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-05-23T18:36:40+00:00Added an answer on May 23, 2026 at 6:36 pm

    From UINavigationController reference:

    This method (popViewControllerAnimated:) removes the top view controller from the stack and makes
    the new top of the stack the active view controller. If the view
    controller at the top of the stack is the root view controller, this
    method does nothing. In other words, you cannot pop the last item on
    the stack.

    You can try the setViewControllers:animated: method instead.

    - (void) goNext {
    
        NextViewController* nextWindow = [[[NextViewController alloc] initWithNibName:@"NextView" bundle:nil] autorelease];
        [self.navigationController setViewControllers:[NSArray arrayWithObject:detailViewController] animated:YES];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created one navigation based application. In that first view show me the
I have project that I'm working on that is going to require a webserver.
I have a project that I'm currently working on but it currently only supports
I have a project that I would like to start beta testing soon, it
I have project, this contains header files like. #import Three20/TTButton.h #import Three20/TTStyle.h #import Three20/TTStyleSheet.h
I have a project based on Xcode's NavigationController template. This template has a navigationController
I have a VS 2005/MSBuild 2.0 project (let's call it Project A) that I
I have project that creates dlls. These dlls are invoked from python later by
I have project that relies heavily on video and leverages html5 video when available.
I am creating a project in which I have three UITextField s and one

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.