iOS--badgeValue(角标)

//通知传值

NSString *badgeNum =[NSString stringWithFormat:@"%@",[getMsgNum valueForKey:@"object"]];

UIViewController *tController = [self.tabBarController.viewControllers objectAtIndex:3];

int badgeValue = [badgeNum intValue];

if (badgeValue >0) {

tController.tabBarItem.badgeValue = [NSString stringWithFormat:@"%d",badgeValue];

}else{

tController.tabBarItem.badgeValue = nil;

}

做下笔记,省得忘了O(∩_∩)O哈哈~

你可能感兴趣的:(iOS--badgeValue(角标))