I would like to set an action to specific tab on UITabBarController. How can I do this?
See my code below:
Update with code
@interface AccountTabViewController : UIViewController <UITabBarControllerDelegate, UITabBarDelegate>
{
IBOutlet UITabBarController *tabController;
IBOutlet UITabBar *tabBar;
}
- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController
{
if(tabBarController.selectedIndex == 0)
{
[self dismissModalViewControllerAnimated:YES];
}
}
It never get into the method! Please help.
See UITabBarDelegate reference and UITabBarControllerDelegate Protocol Reference.
The method you are looking for is
or one of these:
Also, UITabBarController reference.