每日UILocalNotification不止一次射击

你好,我面临一个奇怪的问题。 其实我想在上午8:00安排每日通知(每天一次)。 以下是我安排每日通知的代码。

NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; [formatter setDateFormat:@"HH:mm"]; NSDate *date = [[NSDate alloc] init]; date = [formatter dateFromString:@"08:00"]; UILocalNotification *localNotification = [[UILocalNotification alloc] init]; localNotification.fireDate = date; localNotification.timeZone=[NSTimeZone defaultTimeZone]; localNotification.alertBody = @"You just received a local notification"; localNotification.alertAction = @"View Details"; localNotification.soundName = UILocalNotificationDefaultSoundName; localNotification.repeatInterval = NSDayCalendarUnit; [[UIApplication sharedApplication] scheduleLocalNotification:localNotification]; [formatter release]; [date release]; 

我的问题是,我收到2个本地通知。 一个在上午8:00,另一个在上午10:00。 为什么我在上午10点收到通知。 我只在上午8:00安排。 我知道UILocalNotification库在大多数苹果设备上都有其他一些奇怪的问题/错误。 我只想确认在我的代码中是否有一些错误,或者是UILocalNotification库的一个奇怪的行为。 我不知道苹果为什么不解决许多开发者关于UILocalNotification报告的问题。

注意:我正在使用Xcode 4.6和iOS 6.1

这将是最好的链接,以获得您的答案。