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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:36:00+00:00 2026-06-03T05:36:00+00:00

Today, after hunting a nasty bug, i tracked down the order of view controllers

  • 0

Today, after hunting a nasty bug, i tracked down the order of view controllers being poped,
in case PopToRootNavigationController is called. i was pretty shocked.

Let’s say we have 3 view controllers

A (root)

B

  C

if we call PopToRoot on controller C. the first controller being removed from the stack is B, only after B is removed, controller C is being removed.

I was expected the exact opposite. what the last one that was pushed is the first one the be popped.

Can someone explain why apple choose this kind of behavior?

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-06-03T05:36:01+00:00Added an answer on June 3, 2026 at 5:36 am

    Say you have 100 viewcontrollers on the stack and you want to perform

    popToRootViewControllerAnimated:
    

    so popping every view controller one by one till the last view controller is reached doesn’t make sense.. because then you are expecting it to release every object one by one and this will take time .. so what ios does is , it just pops to the last view controller and releases the 2nd view controller. So this way once 2nd is released all its subsequent child objects are also released and thus is much faster (I guess it works on heap system).

    Where as when you pop it like..

    popToViewController:animated:
    

    this Pops view controllers until the specified view controller is at the top of the navigation stack.

    hoping this clears some of the air..

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

Sidebar

Related Questions

Today after installing ssmtp in order to send e-mails using the terminal, I got
I solved a bug today after almost five weeks of effort. What was happening
I've installed Aptana 1.5 today but after the install all my SVN projects give
Today, after Slackware 13.37 installation, i've got the problem: default GCC 4.5.2 cannot compile
After sitting through a session today on Mono at a local .Net event, the
I had a performance problem today that showed up after some profiling. Calls to
I just started learning ASP.NET MVC4 today. After reading tutorials, downloading VS 2012, and
I'm using Silverlight Beta 4 for a LOB application. After finding out today that
I've been developing with kinect XBOX 360 for a while. Today, after connecting a
Today at work, I was given a task to fix a bug within our

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.