0

I have a problem with saving EKReminder when I set a EKRecurrenceRule for it. When I'm saving reminder without recurrence rule, reminder is saved. Can anyone help me? I tried everything, but it still not working...

NSError *error = nil;
BOOL saved = [ self.eventStore saveReminder:self.myReminder commit: YES error: &error];

saved object returns NO instead of YES.

saltwat5r
  • 1,107
  • 13
  • 21
  • Can you show error message here? – Bhumit Mehta Jun 04 '14 at 08:33
  • Unfortunately, there is no any error... – saltwat5r Jun 04 '14 at 08:36
  • If you debug NSError *error will show the error message – Bhumit Mehta Jun 04 '14 at 08:44
  • Sorry, however there is a following error: Error Domain=EKErrorDomain Code=18 "A repeating reminder must have a due date." UserInfo=0x1569d1b0 {NSLocalizedDescription=A repeating reminder must have a due date.} – saltwat5r Jun 04 '14 at 08:51
  • Ok, Can you show the code where you are setting EKRecurrenceRule – Bhumit Mehta Jun 04 '14 at 08:58
  • 1
    Thanks! Now it works, and my code is: `EKRecurrenceEnd *endRec=[EKRecurrenceEnd recurrenceEndWithEndDate:newDate]; EKRecurrenceRule *recur=[[EKRecurrenceRule alloc]initRecurrenceWithFrequency:EKRecurrenceFrequencyDaily interval: 1 end:endRec]; unsigned unitFlags=NSYearCalendarUnit|NSMonthCalendarUnit|NSDayCalendarUnit|NSHourCalendarUnit|NSMinuteCalendarUnit|NSSecondCalendarUnit|NSTimeZoneCalendarUnit; NSDateComponents *dailyComponents=[gregorian components:unitFlags fromDate:aDate]; [self.myReminder setDueDateComponents:dailyComponents]; [self.myReminder addRecurrenceRule:recur];` – saltwat5r Jun 04 '14 at 09:23
  • Ok, glad you worked it out – Bhumit Mehta Jun 04 '14 at 09:26

0 Answers0