gpt4 book ai didi

ios - EKEventStore eventWithIdentifier 导致 EKCADErrorDomain 错误 1010

转载 作者:行者123 更新时间:2023-11-29 12:34:58 24 4
gpt4 key购买 nike

创建日历事件对我来说效果很好,编辑已经存在的事件会导致问题。当我尝试将 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com