【发布时间】:2012-02-12 17:45:35
【问题描述】:
我设置了每分钟重复一次的本地通知,但是我需要应用程序徽章编号每次递增。当我现在运行它时,它似乎没有增加,它只是保持 1。请有人帮我吗?
这是我创建通知的方式:
// Create the UILocalNotification
UILocalNotification *myNotification = [[UILocalNotification alloc] init];
myNotification.alertBody = @"Blah blah blah...";
myNotification.alertAction = @"Blah";
myNotification.soundName = UILocalNotificationDefaultSoundName;
myNotification.applicationIconBadgeNumber++;
myNotification.timeZone = [NSTimeZone defaultTimeZone];
myNotification.repeatInterval = NSMinuteCalendarUnit;
myNotification.fireDate = [[NSDate date] dateByAddingTimeInterval:30];
[[UIApplication sharedApplication] scheduleLocalNotification:myNotification];
【问题讨论】:
-
你能贴一些代码吗?
-
@HeikoG 我已经添加了用于创建通知的代码。
-
@TheCrazyChimp 你有没有找到解决这个问题的方法?
标签: iphone uilocalnotification