I have following example where I get:
Error getting all calendars: Error Domain=EKCADErrorDomain Code=1013 "The operation couldn’t be completed. (EKCADErrorDomain error 1013.)"
This is a place:
_estore = EKEventStore()
_estore.reset()
_estore.requestAccessToEntityType(EKEntityTypeEvent, completion: {(granted:Bool!, error:NSError!) in
if granted == true {
println("######### allowed calendar accounts #########")
var calendars = self._estore.calendarsForEntityType(EKEntityTypeEvent) // <-- Exception
}
})//block
I get proper popup Allow/No
- I click on Allow and with debug I enter under granted
But get Exception.
from THIS answer by @yunas
I tried to wrap my code with:
if _estore.respondsToSelector(Selector("completion:")){ /* ... */ }
But in this case I never enter to that if
Whats is wrong with code?
Please help,