Oz0234
Oz0234

Reputation: 148

EKEventStore eventWithIdentifier causes EKCADErrorDomain error 1010

Creating calendar events works fine for me, it's editing already existing event that causes problems. When I try to use eventWithIdentifier for an instance of a EKEventStore object it logs out he error:

Error getting event with identifier 5E5EA399-1852-4A50-8155-CD5CDCE69317: Error Domain=EKCADErrorDomain Code=1010 "The operation couldn’t be completed. (EKCADErrorDomain error 1010.)"

I've been looking around for explanation of this error but with no luck, anyone got any clue? Here's the relevant code I think

    if (!_eventStore)
    {
        _eventStore = [[EKEventStore alloc] init];

    }

    if ([_eventStore respondsToSelector:@selector(requestAccessToEntityType:completion:)]) {
        // iOS 6 and later
        [_eventStore requestAccessToEntityType:EKEntityTypeEvent completion:^(BOOL granted, NSError *error) {
            if (granted) {
                EKEvent *event = [_eventStore eventWithIdentifier:_calEventIdentifier];
                [self editCalendarEventWithOldEvent:event];

            }
        }];
    } else {
        EKEvent *event = [_eventStore eventWithIdentifier:_calEventIdentifier];
        [self editCalendarEventWithOldEvent:event];

    }

Upvotes: 1

Views: 2317

Answers (1)

pejalo
pejalo

Reputation: 981

There are multiple identifiers for EKEvent objects. I also got this error when passing EKCalendarItem's calendarItemIdentifier to eventWithIdentifier:.

Make sure you pass a value obtained from EKEvent's eventIdentifier property.

Upvotes: 2

Related Questions