views:

862

answers:

1

Hello,

I trying to use tabbar badges but i have problem ... I have found how to set the badge

but i can't find how to catch the touch event for the tabbaritem so i can delete the badge when the user is on the corresponding tabbaritem

Thanks for your help

+1  A: 

You need to implement tabBarController:didSelectViewController: on the tab bar's delegate. To clear the badge, set it to nil. For example:

- (void) tabBarController:(UITabBarController*)aTabBarController
  didSelectViewController:(UIViewController*)viewController
{
    viewController.tabBarItem.badgeValue = nil;
}
Will Harris