0

[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
4

0 に答える 0