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

  • Home
  • SEARCH
  • 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 4112146
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T22:09:28+00:00 2026-05-20T22:09:28+00:00

I have a UITabBarControllerDelegate method that determines the title of the UITabBarItem and does

  • 0

I have a UITabBarControllerDelegate method that determines the title of the UITabBarItem and does something accordingly. This works well for items in my UITabBar but when I click on the More button the rest of my UITabBarItems are in a UITableView. How can I determine the title in the More section?

- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController
{

    if ([self.tabBarController.selectedViewController.title isEqualToString:@"All"]) {
        //do something
    }
}
  • 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-20T22:09:29+00:00Added an answer on May 20, 2026 at 10:09 pm

    Whenever you select a view controller in your UITabBarController, the method you mention will be called, and most important, the view controller currently shown will be passed to you as parameter; you can then use the following code to find the class and title of the controller, including the “more” controller:

    - (void)tabBarController:(UITabBarController *)tabBarController 
     didSelectViewController:(UIViewController *)viewController
    {
        NSLog(@"controller class: %@", NSStringFromClass([viewController class]));
        NSLog(@"controller title: %@", viewController.title);
    }
    

    In a quick test, just by adding a couple of controllers in Xcode, this is what you get in the console:

    2011-03-28 09:13:21.795 TabTest[39015:207] controller class: UIViewController
    2011-03-28 09:13:21.797 TabTest[39015:207] controller title: (null)
    2011-03-28 09:13:23.922 TabTest[39015:207] controller class: UITableViewController
    2011-03-28 09:13:23.925 TabTest[39015:207] controller title: (null)
    2011-03-28 09:13:24.505 TabTest[39015:207] controller class: UITableViewController
    2011-03-28 09:13:24.506 TabTest[39015:207] controller title: (null)
    2011-03-28 09:13:24.945 TabTest[39015:207] controller class: UIMoreNavigationController
    2011-03-28 09:13:24.945 TabTest[39015:207] controller title: More
    

    On the other side, when you select a controller inside the “more” list, you won’t be notified in your UITabBarControllerDelegate method (weird, IMHO). To help you get notifications when you select controllers in that list, you could do the following:

    - (void)tabBarController:(UITabBarController *)tabBarController 
     didSelectViewController:(UIViewController *)viewController
    {
        NSLog(@"controller class: %@", NSStringFromClass([viewController class]));
        NSLog(@"controller title: %@", viewController.title);
    
        if (viewController == tabBarController.moreNavigationController)
        {
            tabBarController.moreNavigationController.delegate = self;
        }
    }
    
    - (void)navigationController:(UINavigationController *)navigationController didShowViewController:(UIViewController *)viewController animated:(BOOL)animated
    {
        if (navigationController == self.tabBarController.moreNavigationController)
        {
            NSLog(@"more controller class: %@", NSStringFromClass([viewController class]));
            NSLog(@"more controller title: %@", viewController.title);
        }
    }
    

    Your class should also implement the UINavigationControllerDelegate protocol, of course.

    This is the result of a sample run, using the above code and tapping a couple of times in the UITabBar and the “more” list:

    2011-03-28 09:27:42.496 TabTest[39113:207] controller class: UIViewController
    2011-03-28 09:27:42.498 TabTest[39113:207] controller title: (null)
    2011-03-28 09:27:44.306 TabTest[39113:207] controller class: UIMoreNavigationController
    2011-03-28 09:27:44.307 TabTest[39113:207] controller title: More
    2011-03-28 09:27:44.310 TabTest[39113:207] more controller class: UIMoreListController
    2011-03-28 09:27:44.311 TabTest[39113:207] more controller title: More
    2011-03-28 09:27:45.632 TabTest[39113:207] more controller class: SecondViewController
    2011-03-28 09:27:45.634 TabTest[39113:207] more controller title: (null)
    2011-03-28 09:27:47.156 TabTest[39113:207] more controller class: UIMoreListController
    2011-03-28 09:27:47.156 TabTest[39113:207] more controller title: More
    2011-03-28 09:27:48.581 TabTest[39113:207] controller class: UITableViewController
    2011-03-28 09:27:48.582 TabTest[39113:207] controller title: (null)
    

    Hope this helps!

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

Sidebar

Related Questions

I have a RootViewController that has some UITabBarController properties: @interface RootViewController : UIViewController<LoginViewDelegate, UITabBarControllerDelegate>
have such zend query: $select = $this->_table ->select() ->where('title LIKE ?', '%'.$searchWord.'%') ->where('description LIKE
Have you managed to get Aptana Studio debugging to work? I tried following this,
I have a UIView that is pushing a UITableViewController that is contained inside of
Have noticed issue while testing iphone app that if one quickly opens/dismisses a modal
Have a look at the menus on this page: http://www.pieterdedecker.be/labs/vspwpg/?page_id=96 They look okay in
have a table that dynamically generates text boxes in run time. I want to
Have a build process that can't be edited and need to pack another war
I have a project that adds elements to an AutoCad drawing. I noticed that
I have a script that appends some rows to a table. One of the

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.