当我将[NSCalendar + autoupdatingCurrentCalendar]设置为UILocalNotification的重复日历时,然后使用UILocalNotification调用[UIApplication -scheduleLocalNotification:],本地通知不会被安排!
这是iOS 4.3的错误吗?
这是代码:
UILocalNotification *l = [[UILocalNotification alloc] init];
l.fireDate = [NSDate dateWithTimeIntervalSinceNow:30];
l.alertBody = [NSString stringWithFormat:@"alert time :%@,time zone %@",l.fireDate,l.timeZone];
l.alertAction = @"OK";
l.hasAction = YES;
l.repeatInterval = NSDayCalendarUnit;
l.repeatCalendar = [NSCalendar autoupdatingCurrentCalendar];
[application scheduleLocalNotification:l];
NSLog("all local notifs: %@", [[UIApplication sharedApplication] scheduledLocalNotifications]) //empty array