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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:26:14+00:00 2026-05-18T00:26:14+00:00

My application has 3 tab bar items, each mapped to a separate view controller.

  • 0

My application has 3 tab bar items, each mapped to a separate view controller. My problem is the first controller is a UINavigation controller, and it drills-down about 3 levels deep. I don’t have any problems with the navigation, but when I click on a different tab bar item and then when I return to the first tab bar item (the one with the UINav controller), I’d prefer it to reset back to the first controller in the nav sequence.

I read that you have to do something like:

- (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item
{
    [[self navigationController] popViewControllerAnimated:NO];
}

But I’m not sure where I should put this method. Who is the delegate for the tab bar controller? It’s setup in AppDelegate… should it go in there?

Thanks.

  • 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-18T00:26:14+00:00Added an answer on May 18, 2026 at 12:26 am

    Sure, in your AppDelegate when you are creating the UITabBarController you can set the tab bar controller’s delegate to be self (i.e. the AppDelegate). Then you can put the tabBar:didSelectItem: method in your AppDelegate and it should be called whenever the user taps a UITabBarItem. I would create an instance variable property in your AppDelegate and keep a reference to the UITabBarItem which is used for the Nav controller tab (Let’s call it tabBarItemForNavControllerTab). You should also have a reference to the nav controller that lives in that first tab so that you can control it from the AppDelegate (Let’s call it navControllerInFirstTab)

    - (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item
    {
        if (item != self.tabBarItemForNavControllerTab) {
            [self.navControllerInFirstTab popToRootViewControllerAnimated:NO];
        }
    }

    You can use popToRootViewControllerAnimated: on the UINavigationController instead of popping each one off the stack individually.

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

Sidebar

Related Questions

I have created tab bar programmatically in the view controller. In my application, Initially
I created a window application, which has a tabbar controller with four tabbar items.
Let's have an example. In application I have a tab bar controller. Tab bar
My application has a tab bar, and in one tab I have a navigation
My WinForms application has a tab with a System.Windows.Forms.WebBrowser control. There are several controls
I have a app based off the default xcode Tab Bar Application template. It
I'm woking on a simple iphone application. The applicaton has a table view on
Application has an auxiliary thread. This thread is not meant to run all the
My application has a need to let the user choose a date from a
Our application has a file format similar to the OpenDocument file format (see http://en.wikipedia.org/wiki/OpenDocument

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.