views:

77

answers:

1

Hi I have a tabBarController,I want to use the delegate method of tabBarDelegate not of the tabBarControllerDelegate.i.e; I want to use

- (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item

I am doing this:

self.tabBarController.tabBar.delegate = self;

and then using the above method but the problem is that the above method never get called.

+1  A: 

According to the Apple document:

The tab bar view provided by this property is only for situations where you want to display an action sheet using the showFromTabBar: method of the UIActionSheet class.

So I guess you should use the controller's delegate instead.

Nevin
@Nevin If I use tabBarController's - (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController method, the problem is my tabBar has a more tab and when it is tapped the viewController returned by this method is "UIMoreListController".Now How would I identify which controller is currently selected in MoreListController.???
bhatti