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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T13:50:45+00:00 2026-05-19T13:50:45+00:00

How can i push a TabBarController to a View? The App is View-Based. In

  • 0

How can i push a TabBarController to a View?

The App is View-Based. In the App I have a XIB with a TabBarController and I want to push the TabBar to the display. I have done everything, and now I don’t know what I’m doing wrong.

Here is the code that should push the TabBarController:

- (void)showTabBar {
TabBar *tbc = [[TabBar alloc] initWithNibName:@"TabBar" bundle:nil];
[self presentModalViewController:tbc animated:YES];
[tbc release];
}

At this moment there is an empty view in the XIB. So the display is white when I run this code. There is also the TabBarController, which I want to see on the display.

Thanks for your help.


UPDATE:

I should say that these are two different classes. The class where the function “showTabBar” is based should push the TabBarController. The second class is TabBar. TabBar is the delegate of the TabBarController.

So I have modified the answer like this, but I have tried both:

[self presentModalViewController:tbc.tabBarController.view animated:YES];

The error now looks like this:

Incompatible Objective-C types 'struct UIView *', expected 'struct UIViewController *' when passing argument 1 of 'presentModalViewController:animated:' from distinct Objective-C type

UPDATE:

Hey the error has gone away. Cool. 😉

But the app is terminating. I’ve seen this behavior before, but I didn’t know what to do.
The debugger console says this:

2011-01-27 15:49:32.629 Touch[3657:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Application tried to present a nil modal view controller on target <StartUp: 0x9300f20>.'
  • 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-19T13:50:46+00:00Added an answer on May 19, 2026 at 1:50 pm

    Because the UITabBarController class inherits from the UIViewController class, tab bar controllers have their own view that is accessible through the view property. When deploying a tab bar interface, you must install this view as the root of your window. Unlike other view controllers, a tab bar interface should never be installed as a child of another view controller.

    http://developer.apple.com/library/ios/#documentation/uikit/reference/UITabBarController_Class/Reference/Reference.html

    What this mean is, this is not “allowed” and Apple can or may in the future reject your application. UITabBarController is intended to be added to the root view(window) in your application delegate. If you want a tabbar to be pushed on later you need to use the UIToolBar with e.g. uisegmentedcontrol or the toolbar buttons.

    Even though some apps does this(e.g WordPress app) you will later find out that you will run onto some issues in the console when presenting viewcontrollers modally.(A warning will be given).

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

Sidebar

Related Questions

So I have programatically created a tabbarcontroller that uses navigation controllers(based on Jeff Fithian's
I mean 100+ MB big; such text files can push the envelope of editors.
In javascript, we can do: [a string, 10, {x : 1}, function() {}].push(another value);
Can a LINQ enabled app run on a machine that only has the .NET
Can anyone tell me how I can display a status message like 12 seconds
I'm accessing a navigation controller from the app delegate and trying to push another
I am writing an app that needs to display a series of approximately 10-20
Here is the thing. I currently have a tabBar controller, with several navigation controllers
How can push a URI like this in CodeIgniter (1.7.1 currently): example.com/seg1/seg2/seg3/seg4/ or example.com/seg1/seg2/
Can somebody point me to a resource that explains how to go about having

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.