I have application that uses Calendar.
The project worked fine until today. I tried to run app on the same device and got an error:
Predicate call to calendar daemon failed: Error Domain=EKCADErrorDomain Code=1013 "The operation couldn’t be completed. (EKCADErrorDomain error 1013.)"
Here is relevant code:
_estore = EKEventStore()
//_estore.reset() // tried - doesn't help
var predicate:NSPredicate! = _eventStore.predicateForEventsWithStartDate(yearsAgo, endDate:toAgo, calendars:allCals)
_eventStore.enumerateEventsMatchingPredicate(predicate, usingBlock:{
(event:EKEvent!, stop:UnsafeMutablePointer<ObjCBool>) in
...
}) // block
I tried without block implementation:
var allEvents:Array<EKEvent> = _eventStore.eventsMatchingPredicate(predicate) as [AnyObject]! as Array<EKEvent>
I checked Device->Settings -> Privacy -> Reminder - is empty
BTW I don't see any permissions into Settings-> Privacy -> Calendar
Sounds like the device doesn't detect that my app uses Calendar.
BTW, I succeeded to fetch contacts
Other info
- iOS ver. 7.1.2
- I have two accounts on device
- reinstall app doesn't help
- code didn't change from yesterday
- Device restart doesn't help
Any suggestions?
[EDIT]
var calendars = _estore.calendarsForEntityType(EKEntityTypeEvent)
returns nothing (a.e. empty list)
Thanks,