У меня проблема с UILocalNotifications.у меня вопрос: можно ли установить тело оповещения о uilocalnotification после того, как оно запланировано ??
заранее спасибо.
-------------------------------------
// scheduling uilocalnotification
localNotification = [[UILocalNotification alloc]init];
NSDate *currDate1 = [defaults objectForKey:@"Default_AlarmTime"];
localNotification.fireDate = currDate1;
localNotification.alertBody = @"Alarm";
localNotification.alertAction = @"View";
localNotification.soundName = UILocalNotificationDefaultSoundName;
localNotification.timeZone = [NSTimeZone defaultTimeZone];
localNotification.repeatInterval = NSWeekdayCalendarUnit;
[[UIApplication sharedApplication]scheduleLocalNotification:localNotification];
// changing alert body of existing local notification
Arr=[[UIApplication sharedApplication]scheduledLocalNotifications];
for (int k=0;k<[Arr count];k++)
{
localNotification = [Arr objectAtIndex:k];
NSLog(@"%@",localNotification.fireDate);
dateFormat = [[NSDateFormatter alloc] init];
[dateFormat setTimeZone:[NSTimeZone defaultTimeZone]];
[dateFormat setDateFormat:@"hh:mma"];
dateString = [dateFormat stringFromDate:localNotification.fireDate];
NSLog(@"%@",dateString);
currDate = [defaults objectForKey:@"Default_AlarmTime"];
NSLog(@"%@",currDate);
if ([currDate isEqualToString:dateString])
{
localNotification.alertBody = @"Haiiiiii";
}
}
---------------------------