EKCADErrorDomain Code=1013

When I run the following code while the Reminders app has never been used, I get an error that says: Error getting all calendars: Error Domain=EKCADErrorDomain Code=1013 "(null)"


eventStore = EKEventStore()

let calendars = eventStore.calendarsForEntityType(EKEntityType.Reminder)


I googled that error message and got nothing from developer.apple.com. Where can I get more information on that error? What can I learn from that error message that would help me solve my problem?

Replies

I've just run into this problem. After 'requestAccess' the documentation says to call 'reset' on the EKEventStore. However even this did not get things working. However getting a new eventInstance did. I'm using objective c, so I release the EKEventStore object I was using and allocate a new one.

It took me two hours of trying to fix it until I used your approach. Apple should fix that is a bug. Thank you for the solution.

the first thing you need be sure to include the NSRemindersUsageDescription key in your

Info.plist
file.


then


var eventStore: EKEventStore = EKEventStore()


eventStore.requestAccess(to: .reminder) { (isAccessToEventStoreGranted, error: Error?) in

if let error = error {

print("Error: \(error.localizedDescription)")

return

}

if isAccessToEventStoreGranted == true {

// do sth

}

}


the problem is .reminder in "requestAccess"

how to resolve it?