Thursday, May 23, 2013

applicationIconBadgeNumber example UIApplication ios


[UIApplication applicationIconBadgeNumber]

The number currently set as the badge of the application icon in Springboard.
@property(nonatomic) NSInteger applicationIconBadgeNumber
Discussion
Set to 0 (zero) to hide the badge number. The default is 0.
Example of [UIApplication applicationIconBadgeNumber]
[UIApplication sharedApplication].applicationIconBadgeNumber += notification.applicationIconBadgeNumber;
Example of [UIApplication applicationIconBadgeNumber]
- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification {

    [UIApplication sharedApplication].applicationIconBadgeNumber=application.applicationIconBadgeNumber-1;
}
Example of [UIApplication applicationIconBadgeNumber]
//clear app badge
[UIApplication sharedApplication].applicationIconBadgeNumber=0;