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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T01:30:34+00:00 2026-06-10T01:30:34+00:00

I have a UITabBarController which contains 4 tabs. On each tab there should be

  • 0

I have a UITabBarController which contains 4 tabs. On each tab there should be an icon within the navigationbar which allows the user to open my settings view. I solved this by creating a parent class for those 4 tabs and added an icon within the viewDidLoad method which calls a method that does the push. This soluation worked as expected so far.

But :-)! Now I would like to have this settings view open only one time. The solution I have at the moment allows the user to open the settings view on all 4 tabs simultaniously. I don’t want that – Is there an approach to have the settings open only one time?

Here’s my code (which is placed in the parent file)

-(void)viewDidLoad
{
    UIBarButtonItem *leftButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCompose target:self action:@selector(showSettings)];
}

- (void)showSettings
{
    [self.navigationController pushViewController:[[SettingsViewController alloc] initWithNibName:@"SettingsViewController" bundle:nil] animated:YES];
}

Any advice?

  • 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-10T01:30:35+00:00Added an answer on June 10, 2026 at 1:30 am

    Assuming all your tabs are UINavigationControllers, in -showSettings walk the other tabs and pop the navigation view controller if it’s a SettingsViewController.

    - (void)showSettings
    {
        for (UINavigationController *navController in self.tabBarController.viewControllers)
            if ([navController.viewControllers.lastObject isKindOfClass:[SettingsViewController class]])
                 [navController popViewControllerAnimated:NO];
        [self.navigationController pushViewController:[[SettingsViewController alloc] initWithNibName:@"SettingsViewController" bundle:nil] animated:YES];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a UITabBarController that has 3 tabs. Each tab contains a UITableViewController. When
I have a UITabBarController in my MainWindow.xib. Each tab contains a UINavigationController which has
I have a UITabBarController which containing 4 different UIViewControllers . On first tab there
I have a uitabbarcontroller, which contains multiple tabs and viewControllers. I am trying to
I have a UITabBarController that holds several tabs of which one tab (third Tab,
I have a UITabBarController with three tabs: each is a navigation controller with a
I have a UINavigationController inside a UITabBarController. When a user presses the first tab,
I have an uitabbarcontroller which contains a couple uiViewControllers. When i show one of
I have an app which has a UITabBarController, and when different tabs are pressed,
I have a UITabBarController with five views, one of which has a UINavigationController within

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.