我正在尝试在数组日期与当前日期相同时收到通知,此代码用于此任务
NSDateFormatter *Form = [[NSDateFormatter alloc] init];
[Form setDateFormat:@"dd/MM/yyyy"];
UILocalNotification *notification = [[UILocalNotification alloc] init];
for (int i=0;i<_convertedBdates.count;i++)
{
NSDate *date =[Form dateFromString:[_convertedBdates objectAtIndex:i ]];
NSLog(@"date%@",date);
if(notification)
{
notification.fireDate = date;
notification.timeZone = [NSTimeZone defaultTimeZone];
notification.alertBody = @"New ";
notification.alertAction = @"View";
notification.soundName = UILocalNotificationDefaultSoundName;
notification.applicationIconBadgeNumber = 1;
[[UIApplication sharedApplication] scheduleLocalNotification:notification];
}
}
建议我做错了什么