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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:58:52+00:00 2026-05-24T04:58:52+00:00

is is possible to pop a view off the navigation stack and then push

  • 0

is is possible to pop a view off the navigation stack and then push another straight onto it?

I’m trying to implement a flat hierarchy for this section and would like to have a segmented controller but I can’t make the segmented controller look anything liked I want, hence why I’m trying to use the navigation controller.

When a button is clicked I executed this code:

[[self navigationController] popViewControllerAnimated:YES];
        MapsViewController *aViewController = [[MapsViewController alloc]
                                               initWithNibName:@"MapsViewController" bundle:nil];
[self.navigationController pushViewController:aViewController animated:NO];
[aViewController release];

It’s popping off ok but theres no sign of any pushing! Any help would be appreciated.

  • 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-24T04:58:52+00:00Added an answer on May 24, 2026 at 4:58 am
     MapsViewController *aViewController = [[MapsViewController alloc]
                                            initWithNibName:@"MapsViewController" bundle:nil];
         // locally store the navigation controller since
         // self.navigationController will be nil once we are popped
     UINavigationController *navController = self.navigationController;
    
         // retain ourselves so that the controller will still exist once it's popped off
     [[self retain] autorelease];
    
         // Pop this controller and replace with another
     [navController popViewControllerAnimated:NO];//not to see pop
    
     [navController pushViewController:aViewController animated:YES];//to see push or u can change it to not to see.
    

    Or

     MapsViewController *aViewController = [[MapsViewController alloc]
                                            initWithNibName:@"MapsViewController" bundle:nil];
    
    
    UINavigationController *navController = self.navigationController;
    
    //Get all view controllers in navigation controller currently
    NSMutableArray *controllers=[[NSMutableArray alloc] initWithArray:navController.viewControllers] ;
    
    //Remove the last view controller
    [controllers removeLastObject];
    
    //set the new set of view controllers
    [navController setViewControllers:controllers];
    
    //Push a new view controller
    [navController pushViewController:aViewController animated:YES];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible with IASK to have a PSMultiValueSpecifier automatically pop the stack when
i am using navigation based application but i want to pop my view from
Possible Duplicate: .NET - What’s the best way to implement a catch all exceptions
Is it possible to pop up window from a json line. Example, this link
I know pop ups are not good and should be avoided if possible but
Is it possible to change the border color, navigation bar style/color, and arrow style/color
Is it possible to add menu items to JChart2D's ChartPanel pop up menu, considering
Is it possible to open pop-up windows BEHIND the current active screen using java
Because there are multiple situations in which I would want to pop a view
Possible Duplicate: Delay pop-up for 10 seconds, only pop up once Im having trouble

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.