0
UILocalNotifications와 관련된 문제가 있습니다. 내 질문은 - 그것이 예정된 후 uilocalnotification의 경고 시체를 설정할 수 있습니까 ??예약 후 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";
}
}
---------------------------
제 지식은 아니요. 당신은 일정을 재조정하거나 간접적으로 경고 기관을 가져야합니다. –