2012-02-22 2 views
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"; 

      } 
     } 
     --------------------------- 
+0

제 지식은 아니요. 당신은 일정을 재조정하거나 간접적으로 경고 기관을 가져야합니다. –

답변

0

내가 아는 한, 이것은 불가능합니다. 이미 예약 된 알림을 변경하려면 알림을 취소하고 완전히 다시 예약해야합니다.

관련 문제