title: Properly assign alert body for uilocalnotification
body: <p>I have a form where the user fills in all the information such as name,event name,date to remind etc..So what I do is I set a notification based on a key like this</p>
  
  <pre><code>- (void)scheduleNotificationForNotificationID:(NSString *)notificationID1:(NSString *)notificationID2:(NSString *)notificationKey 
  { 
      //Set notification after confirmation of saved data 
  
      Class cls = NSClassFromString(@"UILocalNotification"); 
      reminderNotification = [[cls alloc] init]; 
      if (cls != nil) 
      { 
         NSDateFormatter *dateFormat = [[[NSDateFormatter alloc]init]autorelease]; 
         [dateFormat setDateFormat:@"YYYY-MM-dd HH:mm:ss"]; 
         NSDate *notificationDate = [dateFormat dateFromString:textField2.text]; 
         reminderNotification.fireDate = notificationDate; 
         reminderNotification.timeZone = [NSTimeZone defaultTimeZone]; 
         NSString *reminderText = [NSString stringWithFormat:@"%@ 's %@ on %@",textField.text,textField1.text,strDate];
         reminderNotification.alertBody = reminderText; 
         reminderNotification.alertAction = @"View"; 
         reminderNotification.soundName = @"apple_ring.mp3"; 
         reminderNotification.applicationIconBadgeNumber = 1; 
         //Use name and event name as keys
         NSDictionary *infoDict = [NSDictionary dictionaryWithObjectsAndKeys:notificationID1,@"Name",notificationID2,@"Event",notificationKey,@"Date",nil];  
         reminderNotification.userInfo = infoDict; 
         [[UIApplication sharedApplication] scheduleLocalNotification:reminderNotification]; 
      } 
  }
  </code></pre>
  
  <p><strong>textField holds Name and
  textField1 holds Event Name</strong></p>
  
  <p>So I have a save button action for saving each reminder,where if the button title is "Save",it will save the reminder and insert a new record,if it is "Done",it will edit the reminder details and record will get updated.</p>
  
  <p>Now what's the problem with notification is not of improper firing or not firing etc..The problem is with notification alert body,this is the code of did Receive local notification:</p>
  
  <pre><code>- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification 
  {
      application.applicationIconBadgeNumber = 0;
      NSString *reminderText = [notification.userInfo objectForKey:kReminder];
      [self.addViewController performSelector:@selector(showReminder:) withObject:reminderText afterDelay:1];
  }
  </code></pre>
  
  <p>So here is the action for notification alert body</p>
  
  <pre><code>//Notification alert
  - (void)showReminder:(NSString *)text
  {
      self.reminderAlert = [[UIAlertView alloc] initWithTitle:@"Reminder" message:reminderNotification.alertBody delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil];
      UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(220, 10, 40, 40)];
      UIImage *image= [UIImage imageNamed:@"icon@2x.png"];
      [imageView setImage:image];
  
      [reminderAlert addSubview:imageView];
      [imageView release];
  
      [reminderAlert show];
      [reminderAlert release];
  }
  </code></pre>
  
  <p>Now after I edit the reminder/record details the previous notification gets cancelled any way,but my problem is the alert body is not the same as notification alert body,i.e. notification alert body get's updated,but not alert body i.e. according to name and event name say for example:</p>
  
  <p><strong>"Steve Job's Birthday on July 3rd",if this is initial event at the time of saving
  and if user updates/changes it to "Steve Job's Felicitation on July 3rd"</strong></p>
  
  <p>the alert body is holding the previous event name value,where as notification alert body is holding the correct and properly updated new reminder details.I tried assigning one alert body if the title is save,and another value if title is done,I mean I took several strings to hold the values of name and event name,for save and done actions,declared the string globally,tried to make the string value nil before I assign a reminder body in done action etc...nothing worked!</p>
  
  <p><strong>Hence I assigned the reminder notification alert body itself</strong>.Even this is not working :(</p>
  
  <p>Where am I wrong....???</p>
  
  <p>Please help me and thanks all in advance :)</p>