我知道如何安排 localNotification 并在推送 localNotification 时设置 applicationIconBadgeNumber:
- (void) scheduleNotificationOn:(NSDate*) fireDate
text:(NSString*) alertText
action:(NSString*) alertAction
sound:(NSString*) soundfileName
launchImage:(NSString*) launchImage
andInfo:(NSDictionary*) userInfo
{
UILocalNotification *localNotification = [[UILocalNotification alloc] init];
localNotification.fireDate = fireDate;
....
self.badgeCount ++;
localNotification.applicationIconBadgeNumber = self.badgeCount;
// Schedule it with the app
[[UIApplication sharedApplication] scheduleLocalNotification:localNotification];
[localNotification release];
}
如代码所示,在调用 localNotification 之前设置了 applicationIconBadgeNumber。我想知道是否可以在调用 localNotification 时计算 applicationIconBadgeNumber 并将其显示在应用程序图标附近?