iOS4.3 UILocalNotification不支持[NSCalendar + autoupdatingCurrentCalendar]作为repeatCalendar吗?

时间:2012-10-22 08:34:52

标签: iphone ios

当我将[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

0 个答案:

没有答案