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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T05:39:29+00:00 2026-05-20T05:39:29+00:00

I have found a strange behaviour when trying to push a viewcontroller onto the

  • 0

I have found a strange behaviour when trying to push a viewcontroller onto the stack. The following works fine:

[self.navigationController pushViewController:myViewController animated:YES];

but if I change it to animated:NO it no longer works, doesn’t seem to push at all. I was performing this in a viewWillAppear but I have also tried it in viewDidAppear but with no luck.

Any ideas what could be causing this?

Thanks

  • 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-20T05:39:30+00:00Added an answer on May 20, 2026 at 5:39 am

    The problem is most probably not the call itself, but the placement of the call. Try putting the same action on a UIButton and it should 100% work. I’ve noticed that putting view controller manipulation routines like presentModal… and pushViewController… don’t sometimes work in the viewWill* viewDid* methods. Or try making the calls from those functions with a performSelector:withObject:afterDelay after a short delay and see if that works.

    Edit: there are a couple of ways of doing what you want to do. You can directly modify the navigation stack of a navigation controller, so when you are in view N+1, you can replace view N on the stack (by building a new navigation stack array and setting it in to the navigation controller), then pop, and you’ll get the effect of “popping back to a different view controller”. You can also issue multiple pops and pushes from the view controller you want to leave, but you have to be careful:

    // pop back 2 controllers on the stack to the setup screen
    //
    
    // 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 back 2 controllers to the setup screen
    //
    [navController popViewControllerAnimated:NO];
    [navController popViewControllerAnimated:YES];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I found the following rather strange. Then again, I have mostly used closures in
I'm hacking my way through learning Flex and have found some strange behaviour. When
I have a strange behaviour going on. I am using Seam and JBPM. When
I have found some in the Cappuccino website (vim, textmate and SubEthaEdit), but not
I have found that my HTML is, to be honest, very clunky. Small, simple
I have found some libraries or web services in PHP that does the job.
I have found jQuery to be a great tool to simplify my MVC Views.
I have found that there is generally a singe type or namespace that takes
I have found an interesting issue in windows which allows me to cause the
I have found a few libraries to edit MP3 tags (UltraID3Lib is great) but

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.