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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:33:53+00:00 2026-06-11T01:33:53+00:00

I read that it is bad to have such structure in an iOS application.

  • 0

I read that it is bad to have such structure in an iOS application. But what if an application has a lot of UINavigationControllers and UITabBarControllers. But one UINavigationBar and one UITabBar are always displayed only? Other UINavigationBars and UITabBars are hidden.

EDITED

For example, in navigation-based application I call this code:

- (IBAction)openTabsController:(id)sender {        

    tabOneController *tabOneViewContr = [[[tabOneController alloc] initWithNibName:@"tabOneController" bundle:nil] autorelease];
    UINavigationController *tabOneNavContr = [[UINavigationController alloc] initWithRootViewController:tabOneViewContr];

    tabTwoController *tabTwoViewContr = [[[tabTwoController alloc] initWithNibName:@"tabTwoController" bundle:nil] autorelease];
    UINavigationController *tabTwoNavContr = [[UINavigationController alloc] initWithRootViewController:tabTwoViewContr];


    UITabBarController *tabContr = [[[UITabBarController alloc] init] autorelease];
    tabContr.viewControllers = [NSArray arrayWithObjects:tabOneNavContr,tabTwoNavContr, nil];
    sel.navigationController.navigationBar.hidden = YES;
    [self.navigationController pushViewController:tabContr animated:YES];
}

After calling of this method I have two UINavigationControllers and one UITabBarController. At the same time I have one UINavigationBar and one UITabBar on a screen.

EDITED

Approximate scheme.

enter image description here

From The beginning we have an UINavigationController which allows to navigate between the views (circles). Then after pushing an UITabBar appears and allows to switch between the views. A rectangle with two little rects is a view with a UITabBar with 2 UITabBarItem s. When we presss any UITabBarItem another UIView appears. In this UIView we can press some button which calls another view with another UITabBar. Current UITabBar is visible after pushing if it is not hidden with another UITabBar.
is it more clear now?
The code above works almost perfect (except of some animations and not including Apple’s limitations)

  • 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-11T01:33:55+00:00Added an answer on June 11, 2026 at 1:33 am

    Gargo,

    I’m not sure I understood your question but the apple documentation is clear. If you use - (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated it says that viewController:

    cannot be an instance of tab bar controller and it must not already be
    on the navigation stack.

    Since you do

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

    you are pushing a tab bar controller instance within the navigation stack.

    If you add the structure that you would achieve maybe I can help you to find another solution.

    Hope that helps.

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

Sidebar

Related Questions

I read everywhere that rewriting history of commits that have been published is bad
I've read that it is bad practice, but usually harmless , to place most
I read that Windows wp8 allows native code. So how then have ports such
I read many question about that and tutorials, but the only one executed, and
I've read that it is bad practice to call strlen() in my for loop
I read that both multiple returns and multiple goto statements are bad programming practice.
I have a database that logs when an employee has attended a course and
CAPTCHAs that ask users to read distorted text are fine for sighted people, but
I have an application that I suspect might be leaking a thread or its
I have read that generally abstract classes should not be made Serializable in Java.

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.