在我的iOS应用程序中,我曾使用以下方法访问日历:
EKCalendar* cal = [eventStore calendarWithIdentifier:[calendarIDs objectAtIndex:i]];
Run Code Online (Sandbox Code Playgroud)
通过以下方式向用户询问权限:
eventStore requestAccessToEntityType:EKEntityTypeEvent completion:^(BOOL granted,NSError* error){}
Run Code Online (Sandbox Code Playgroud)
现在这在iOS 7上工作正常,但在iOS 8上,每次调用方法calendarWithIdentfier时我都会遇到以下错误:
Error getting shared calendar invitations for entity types 3 from daemon:
Error Domain=EKCADErrorDomain Code=1013
"The operation couldn’t be completed. (EKCADErrorDomain error 1013.)"
Run Code Online (Sandbox Code Playgroud)
我可以写\读日历没有问题,但我不明白为什么会引发这个异常.我已经尝试了一些这里提出的方法,但在这种情况下它们似乎都没有.