Ios EKEventStore eventWithIdentifier导致EKCADErrorDomain错误1010
创建日历事件对我来说很好,编辑已经存在的事件会导致问题。当我尝试对EKEventStore对象的实例使用eventWithIdentifier时,它会注销错误: 获取标识符为5E5EA399-1852-4A50-8155-CD5CDCE69317的事件时出错:错误域=EKCADErrorDomain代码=1010“操作无法完成。(EKCADErrorDomain错误1010)。” 我一直在四处寻找这个错误的解释,但运气不好,有人得到任何线索吗?我想这是相关的代码Ios EKEventStore eventWithIdentifier导致EKCADErrorDomain错误1010,ios,ekevent,ekeventkit,ekeventstore,Ios,Ekevent,Ekeventkit,Ekeventstore,创建日历事件对我来说很好,编辑已经存在的事件会导致问题。当我尝试对EKEventStore对象的实例使用eventWithIdentifier时,它会注销错误: 获取标识符为5E5EA399-1852-4A50-8155-CD5CDCE69317的事件时出错:错误域=EKCADErrorDomain代码=1010“操作无法完成。(EKCADErrorDomain错误1010)。” 我一直在四处寻找这个错误的解释,但运气不好,有人得到任何线索吗?我想这是相关的代码 if (!_eventS
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];
}
EKEvent
对象有多个标识符。将EKCalendarItem
的calendarItemIdentifier
传递到eventWithIdentifier:
时,我也遇到了此错误
确保传递从
EKEvent
的eventIdentifier
属性获取的值。确保在获取eventIdentifier之前先保存事件,否则它将为零。我使用的是calendarItemIdentifier,这导致了上述错误