title: My remainder IPhone application getting delayed in seconds
body: <p>I have made a remainder application using <code>UIDatePicker</code> and <code>NSLocalNotification</code>. The remainder app is ready and is working, but the remainder gets triggered some seconds later each time.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>-(void)addRemainder
  {
  
      NSDateFormatter *dateform=[[NSDateFormatter alloc]init];
      dateform.dateFormat = @"dd-MM-yyyy HH:mm";
      NSString *formattedDate = [dateform stringFromDate:datePicker.date];
      date=[dateform dateFromString:formattedDate];
      str=[dateform stringFromDate:date];
  
      if(textField1.text!=nil)
      {
  
          notification = [[UILocalNotification alloc] init];
          notification.fireDate = date;
          notification.timeZone = [NSTimeZone defaultTimeZone];
          notification.alertBody = textField1.text;
          notification.alertAction=@"Show me the item";
          notification.soundName = UILocalNotificationDefaultSoundName;
          NSUInteger nextBadgeNumber = [[[UIApplication sharedApplication]    scheduledLocalNotifications] count] + 1;
          notification.applicationIconBadgeNumber = nextBadgeNumber;
          notification.repeatInterval = NSDayCalendarUnit;
          [[UIApplication sharedApplication] scheduleLocalNotification:notification];
  
      }
  
      if ([remainderr isEqualToString:@"edit"])
      {
          [remainder replaceObjectAtIndex:([index integerValue]) withObject:textField1.text];
          [TimeDate replaceObjectAtIndex:([index integerValue]) withObject: str];
          [self.navigationController popViewControllerAnimated:YES];
      }
  </code></pre>