ios - EKEventStore 删除事件抛出错误

标签 ios ekeventstore

我创建了一个 EKEventStore ,确保我有访问权限,创建一个事件并将其持久化。我节省了eventIdentifier一切都很好。这是一个经常性的日历条目。

接下来,我想从重复事件中删除几天。您可能每周五都会定期举行一次 session ,但本周五是一年一度的丁香莓节,因此 session 被取消。

我用 removeEvent:span:commit:error:并按预期进行所有工作。

然后我决定完全从日历中删除该事件。我调用 [self.store removeEvent:event span:EKSpanFutureEvents commit:YES error:&error];我将一些错误/垃圾扔到控制台中。
Error loading date date from daemon: Error Domain=EKCADErrorDomain Code=1010 "The operation couldn’t be completed. (EKCADErrorDomain error 1010.)"
仅当我删除重复事件范围内的特定日期和 EKEventStore 时才会发生这种情况。为事件中的每个缺失日期喷出此行一次。结果是,如果我取消了半打事件,中间有六天的时间,我会收到大量的这些消息。

它似乎不会影响我的代码的功能甚至性能,但我讨厌看到这样的东西涌入控制台,所以我希望有人能帮助我找到一种合理的方法来防止它。

最佳答案

这来自自述文件中的 IOS 开发人员库 SimpleEKDemo 。它说有一个已知的错误。

我所做的是把它放在一个 try catch block 中,然后继续尝试,记录最终被删除。丑陋 !!!

这可能与您的错误相似

https://developer.apple.com/library/ios/samplecode/SimpleEKDemo/Listings/ReadMe_txt.html

1.1 - 针对 iOS 6.0 进行了更新。现在使用 ARC 和 Storyboard。显示如何检查和请求访问用户的日历数据库。删除事件时,您可能会遇到 CADObjectGetRelatedObjects failed with error Error Domain=NSMachErrorDomain Code=268435459 "The operation could not be completed. (Mach error 268435459 - (ipc/send) invalid destination port)"消息。这是一个不影响运行此示例的已知错误。

关于ios - EKEventStore 删除事件抛出错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25872653/

相关文章:

ios - 尽管在 Controller 中设置 tabbar.hidden = NO,TabBar 仍然隐藏

ios - Tilemap 在横向时改变大小

iphone - 使用大量内存的功能

objective-c - 获取实体类型 3 的共享日历邀请时出错,Xcode 6.1.1。 EKCalender、EKSource、EKEventstore 和 Objective C

swift - 更改了哪个日历(使用 EKEventStoreChangedNotification?)

ios - 点击时更改 UICollectionViewCell 上的 ImageView 图像

javascript - 使用卡片 View react native 从服务器获取数据

iphone - iOS:EKEventStore sources/defaultCalendarForNewEvents/calendarsForEntityType 在授权后不返回任何内容

swift - 访问 iCloud 日历事件 - macOS 应用程序

ios - 为什么在 requestAccessToEntity :completion? 中使用 performSegueWithIdentifier 时使用 dispatch_async