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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T18:37:25+00:00 2026-06-07T18:37:25+00:00

I got a very interesting problem here. My iPhone app has an UITabbarController as

  • 0

I got a very interesting problem here. My iPhone app has an UITabbarController as rootViewController in the AppDelegate.

If the app is opened the first time, it must be configured basically. For this purpose I create an UINavigationController and tell the tabbarController to present it modally:

firstRun = [[firstRunViewController alloc] init];
navCtrl = [[UINavigationController alloc] initWithRootViewController:firstRun];
[[self tabBarController] presentModalViewController:navCtrl animated:NO];

When the configuration is done, I’d like to get rid of the firstRunViewController. I’m using this technique very often, using -dismissModalViewControllerAnimated:.

But in this constellation this doesn’t work. It doesn’t matter from what controller I’m calling the dismiss.
I tried it via the tabbarController, the rootViewController, the currently active viewController, of cause self and several other controllers.

EVERY TIME I call -dismissModalViewControllerAnimated: I get this exception:

'UIViewControllerHierarchyInconsistency', reason: 'presentedViewController for controller is itself on dismiss for: <UINavigationController:…

Can anybody help? Thanks in advance, with kind regards, Julian

EDIT
In my AppDelegate I’m using a UITabbarController as rootViewController for the main window:

self.window.rootViewController = self.tabBarController;
[self.window makeKeyAndVisible];

Then I’m creating an UINavigationController and tell the UITabbarController to present the modalViewController:

UINavigationController *navCtrl = [[UINavigationController alloc] initWithRootViewController:firstRun];
[[self tabBarController] presentModalViewController:navCtrl animated:NO];

When I now call -dismissModalViewControllerAnimated: on the firstViewController I’m getting the error from above.

  • 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-07T18:37:27+00:00Added an answer on June 7, 2026 at 6:37 pm

    I finally found the answer myself!
    I just couldn’t see the wood for the trees! I’m quite happy right now! 🙂

    I did really silly things: In the last viewController of the setup viewControllers I had to change the tabars viewControllers corresponding to whether the user is administrator or not. So I did:

    appDelegate.tabBarController.viewControllers = [NSArray arrayWithObjects:appDelegate.readState,
                                                    appDelegate.navCtrl,
                                                    appDelegate.settings, nil];
    

    You can see that I was adding the AppDelegate’s “navCtrl” to the tabbar’s viewControllers. So I was trying to dismiss a viewController I just added to the parentViewControllers (UITabbarController) sub-controllers.

    Dismissing something I want to present just in the same moment is NOT advisable! :))

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

Sidebar

Related Questions

Here is a very interesting java problem I've found: Before book printing was found
I have got very big problem because I would like to get more information
Ruby has this very interesting functionality in which when you create a class with
I've got a very interesting need for jQuery. I need to look into a
I've got an interesting problem with a few different ways to solve it. I'm
I have a very interesting problem on my LinqToSql model. On some of my
So I've got an interesting problem that I need help with faster than I
I've got a very simplistic game set up on the iPhone. Things move around,
Today I got into a very interesting conversation with a coworker, of which one
I'm very interesting in compilation and I've got a question about gcc. I know

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.