创建日历事件对我来说很好,因为编辑已经存在的事件会导致问题。当我尝试为EKEventStore对象的一个实例使用eventWithIdentifier时,它记录了以下错误:
获取标识符为5E5EA399-1852-4A50-8155-CD5CDCE69317的事件时出错: Error Domain=EKCADErrorDomain Code=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];
}发布于 2015-08-25 02:45:33
EKEvent对象有多个标识符。在将EKCalendarItem的calendarItemIdentifier传递给eventWithIdentifier:时,我也得到了这个错误。
确保传递从EKEvent的eventIdentifier属性获得的值。
https://stackoverflow.com/questions/26638431
复制相似问题