Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone unread counts on tabbar

Which is the best way to implement on Cocoa Touch the unread counts on a icon on a TabBar?

I want to mimic the SMS or Mail application behavior, showing the unread message count to the user of my application, with a red dot containing a number.

like image 898
rubenfonseca Avatar asked Mar 04 '09 11:03

rubenfonseca


2 Answers

The property you're looking for is called the badge. You set it by doing something like:

self.tabBarItem.badgeValue = @"1";
like image 56
jonnii Avatar answered Sep 28 '22 01:09

jonnii


Have you looked at: setApplicationBadgeNumber?

[[UIApplication sharedApplication] setApplicationBadgeNumber:int];
like image 35
Meltemi Avatar answered Sep 28 '22 01:09

Meltemi