标签:
//设置tabbar的未读消息数
-(void)setToolbarBadge:(NSUInteger)count
{
if (count !=0) {
if (count > 99)
{
[self.parentViewController.tabBarItem setBadgeValue:@"99+"];
}
else
{
[self.parentViewController.tabBarItem setBadgeValue:[NSString stringWithFormat:@"%ld",(unsigned long)count]];
}
}else
{
[self.parentViewController.tabBarItem setBadgeValue:nil];
}
}
//设置icon的未读消息数
[[UIApplication sharedApplication] setApplicationIconBadgeNumber:0];
标签:
原文地址:http://www.cnblogs.com/huangzs/p/4578425.html