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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T12:07:24+00:00 2026-06-07T12:07:24+00:00

I have my viewControllers like this: startViewController ——> menuViewController \ \ ——> ImportantViewController From

  • 0

I have my viewControllers like this:


startViewController ------> menuViewController 
                                          \
                                           \ ------> ImportantViewController

From startMenu I pushed menuView then I pushed again importantView, on that I have made importantView as my rootViewcontroller for it to become my parent view like as below:

UINavigationController *navControl = [[UINavigationController alloc] initWithRootViewController: vc];
[self presentModalViewController: navControl animated: YES];

From that I pushed view after importantView via:

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

Now my prob is like this:

enter image description here

ImportantVIew as my rootView pushed to menuView pushed to ViewA then pushed to View B then option whether to return to menuView or return to ViewA.

My question is:
I want to make my ViewB as a rootView, then when I go to ImportantView it will then return it to as rootView. Is it possible to have 2 rootView? Or I need to just replace each other?

Help would be much appreciated. 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-07T12:07:25+00:00Added an answer on June 7, 2026 at 12:07 pm

    What is the reason for changing the root view controller all the time?

    With viewA and viewB calling in circle you would build up an endless stack of view controllers. That is probably not what you want to do.

    Take a step back and re-think what you are trying to achive. Do you just want to change between viewA and viewB? In that case you sould go for a different architecture/pattern than the usual pushViewController thing. Read a bit about removeFromParentViewController or transitionFromViewController:toViewController:. Or get familiar with manipulating the chain of view controllers yourself. Those things might help achieving the user experience that you want to create without building up an endless stack of view controllers.

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

Sidebar

Related Questions

I have 4 ViewControllers , startViewController as the initial View Controller. This contains my
I have an NSString declared like this : .h: @interface ViewController : UIViewController {
For example I have a ViewController named firstViewController. Then I would like to call
I have 10 viewControllers in my app. I have pushed all these viewControllers using
In my navigation stack, I have 2 viewcontrollers, which were pushed to the navigation
I've designed and build game based on UINavigationController. I have several ViewControllers like on
I have a navigationBar, with a UIImage on it's title, like this: self.navigationItem.titleView =
I have viewcontrollers set up to track gestures and commit an action, in this
in my app i have an UITabBarController with UINavigationControllers initialized like this UINavigationController *newsNavigationController
I try to POST images to server. I have finished it successfully like 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.