创建日历事件对我来说很好,它正在编辑会导致问题的现有事件。当我尝试将eventWithIdentifier用于EKEventStore对象的实例时,它注销错误:
获取标识符为5E5EA399-1852-4A50-8155-CD5CDCE69317的事件时出错:错误域= EKCADErrorDomain代码= 1010“操作无法完成。(EKCADErrorDomain错误1010。)”
我一直在四处寻找这个错误的解释,但是没有运气,有人知道吗?这是我认为的相关代码
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
属性获得的值。