Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/102.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios EKEventStore eventWithIdentifier导致EKCADErrorDomain错误1010_Ios_Ekevent_Ekeventkit_Ekeventstore - Fatal编程技术网

Ios EKEventStore eventWithIdentifier导致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

创建日历事件对我来说很好,编辑已经存在的事件会导致问题。当我尝试对EKEventStore对象的实例使用eventWithIdentifier时,它会注销错误:

获取标识符为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
属性获取的值。

确保在获取eventIdentifier之前先保存事件,否则它将为零。我使用的是calendarItemIdentifier,这导致了上述错误