ios - EKEventStore eventWithIdentifier 导致 EKCADErrorDomain 错误 1010

标签 ios ekevent ekeventkit ekeventstore

创建日历事件对我来说效果很好,编辑已经存在的事件会导致问题。当我尝试将 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 对象有多个标识符。将 EKCalendarItemcalendarItemIdentifier 传递给 eventWithIdentifier: 时,我也遇到了这个错误。

确保传递从 EKEventeventIdentifier 属性获得的值。

关于ios - EKEventStore eventWithIdentifier 导致 EKCADErrorDomain 错误 1010,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26638431/

相关文章:

ios - 如何在使用 Callkit 接听电话后保留 native UI

ios - 如何将 "20110912T220000"(NSString) 给出的日期转换为 NSDate

iphone - iPhone模拟器日历是否为事件正确存储 "availability"?

java - JNA Objective-C (Rococoa) 日历回调

ios - 在 iOS 6 上获取 Facebook 日历列表

ios - 在 64 位处理器上运行时出现 Core Audio 错误

ios - React Native JSON.stringify 无法序列化循环结构

ios - OpenGL 2.0 根据对象大小调整纹理大小

ios - 尝试保存 EKEvent 时失败

events - 重复 requestAccessToEntityType :EKEntityTypeEvent during development 的过程