views:

20

answers:

0

How do I add a badgeValue or setApplicationIconBadgeNumber to a button?

I'm wanting to add a badgeValue to buttons. In the following picture you can see the app has a e-mail icon with a badge on it representing how many unread messages there are.

alt text

I am creating an app that is similar; it will have a (faux) Mail system where you get messages from various sources and I would like the button to have a badgeValue

I know that:

self.tabBarItem.badgeValue = @"1";

Works, but this is for tabBarItem's and not buttons.

I know that:

[[UIApplication sharedApplication] setApplicationIconBadgeNumber:10];

But this sets it outside of the application (on your iphone home screen).

Thus, how do you add a badgeValue or badgeNumber to a button? Thanks.