I have a recurring event in calendar. I'm delete a single event using this code [store removeEvent:event span:EKSpanThisEvent commit:YES error:&errorThis];
and this methods returns true
but the event is not deleted from the calendar.
iOS - Delete Recurring EKEvent, event appears again
2k views Asked by Afnan At
2
There are 2 answers
1
On
Please make sure you have only one instance of EKEventStore in singleton pattern in your app :
static EKEventStore *eventStore = nil;
+ (EKEventStore *)getEventStoreInstance
{
if (eventStore == nil){
@synchronized(self){
if (eventStore == nil){
eventStore = [[EKEventStore alloc] init];
}
}
}
return(eventStore);
}
On EKCalendarItem Class reference using the property calendarItemExternalIdentifier you find this
So you want delete only a recurrence you have to do something like this:
Your method instead, deletes only the first occurrence. If you want delete all recurring events just change "span" parameter in EKSpanFutureEvents.
EDIT: Now only deletes the matching recurrent event, not everything.