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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:17:11+00:00 2026-05-25T18:17:11+00:00

I just came across a crash showing a NSInvalidArgumentException with this message on an

  • 0

I just came across a crash showing a NSInvalidArgumentException with this message on an app which wasn’t doing this before.

Application tried to present modally an active controller
UITabBarController: 0x83d7f00.

I have a UITabBarController which I create in the AppDelegate and give it the array of UIViewControllers.

One of them I want to present modally when tapped on it. I did that by implementing the delegate method

- (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController

If that view controller is of the class of the one I want to present modally, I return NO and do

[tabBarController presentModalViewController:viewController animated:YES];

And now I’m getting that error, which seems to mean that you can’t present modally a view controller that is active somewhere else (in the tabbar…)
I should say I’m on XCode 4.2 Developer Preview 7, so this is iOS 5 (I know about the NDA, but I think I’m not giving any forbidden details). I currently don’t have an XCode installation to test if this crashes compiling against the iOS4 SDK, but I’m almost entirely sure it doesn’t.

I only wanted to ask if anyone has experienced this issue or has any suggestion

  • 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-25T18:17:12+00:00Added an answer on May 25, 2026 at 6:17 pm

    Assume you have three view controllers instantiated like so:

    UIViewController* vc1 = [[UIViewController alloc] init];
    UIViewController* vc2 = [[UIViewController alloc] init];
    UIViewController* vc3 = [[UIViewController alloc] init];
    

    You have added them to a tab bar like this:

    UITabBarController* tabBarController = [[UITabBarController alloc] init];
    [tabBarController setViewControllers:[NSArray arrayWithObjects:vc1, vc2, vc3, nil]];
    

    Now you are trying to do something like this:

    [tabBarController presentModalViewController:vc3];
    

    This will give you an error because that Tab Bar Controller has a death grip on the view controller that you gave it. You can either not add it to the array of view controllers on the tab bar, or you can not present it modally.

    Apple expects you to treat their UI elements in a certain way. This is probably buried in the Human Interface Guidelines somewhere as a “don’t do this because we aren’t expecting you to ever want to do this”.

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

Sidebar

Related Questions

Just came across this by Chris Coyier - http://css-tricks.com/examples/CSSTabs/ Can anyone explain me, how
I just came across with a problem using XmlDocument.LoadXml . The application was crashing,
I just came across this weird problem that is happening in IE. In the
Just came across this article about NOSQL patterns (not mine). It's covers lots of
I just came across something like this: String sample = somejunk+%3cfoobar%3e+morestuff; Printed out, sample
I just came across this question in the Go FAQ, and it reminded me
just wondering if someone else came across this. I got this piece of code
Just came across the Piictu iOS app ( Screenshot ). The UI looks great
I just came across this by accident and I want to check if this
Just came across this quote in a book on OOP that I'm reading, A

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.