iOS EventKit - 未从日历中删除事件 [英] iOS EventKit - Event is not being deleted from calendar

查看:520
本文介绍了iOS EventKit - 未从日历中删除事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用以下代码删除事件

I'm deleting event using the following code

[store requestAccessToEntityType:EKEntityTypeEvent completion: ^(BOOL granted, NSError *error) {
    if (granted) {
        EKEvent *event = [store eventWithIdentifier:eventIdentifier];
        NSError *eventDeleteError = nil;
        if (event) {
            [store removeEvent:event span:EKSpanThisEvent error:&eventDeleteError];
        }

        if (eventDeleteError) {
            NSLog(@"Event Deletion Error: %@", eventDeleteError);
        }

}];

我在 eventDeleteError 中没有错误但是关注消息显示在控制台日志中

I got no error in eventDeleteError but following message appear in the console log


CADObjectGetInlineStringProperty 为<$ c $获取UUID失败c> EKPersistentAttendee 错误错误域= EKCADErrorDomain代码= 1010操作无法完成。(EKCADErrorDomain错误1010。)

CADObjectGetInlineStringProperty failed fetching UUID for EKPersistentAttendee with error Error Domain=EKCADErrorDomain Code=1010 "The operation couldn’t be completed. (EKCADErrorDomain error 1010.)"


推荐答案

我在删除日历时遇到类似错误:

I was getting similar error on removing a calendar:


CADObjectGetIntProperty失败并显示错误错误Domain = EKCADErrorDomain Code = 1010操作无法完成。(EKCADErrorDomain错误1010.)
CADObjectGetRelation失败,错误错误域= EKCADErrorDomain代码= 1010操作无法完成。(EKCADErrorDomain错误1010。)

CADObjectGetIntProperty failed with error Error Domain=EKCADErrorDomain Code=1010 "The operation couldn’t be completed. (EKCADErrorDomain error 1010.)" CADObjectGetRelation failed with error Error Domain=EKCADErrorDomain Code=1010 "The operation couldn’t be completed. (EKCADErrorDomain error 1010.)"

因为它不完全是同样的消息我将解释是什么帮助了我。
问题来自对新的EventStore对象进行删除操作。尝试确保持有对EventStore的引用,并在同一对象上调用添加和删除操作。

As it is not exactly the same message I will just explain what helped me. The issue came from making "remove" operation on a new EventStore object. Try to make sure you hold a reference to EventStore and both adding and removing operations are called on the same object.

这篇关于iOS EventKit - 未从日历中删除事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆