EKEvent eventIdentifier返回null [英] EKEvent eventIdentifier returns null

查看:446
本文介绍了EKEvent eventIdentifier返回null的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试获取EKEvent的标识符时,我得到的只是一个nil值。因为在iOS5中EKEvent是EKCalendarItem的子类,我想我可能能够获得EKCalendarItem的UUID,但是它也会返回nil。

When I try to get the identifier of an EKEvent, all I get is a nil value. Since in iOS5 EKEvent is a subclass of EKCalendarItem, I figured I might be able to get the EKCalendarItem's UUID, but that returns nil as well.

在尝试访问标识符或UUID属性时,我偶尔会遇到此错误:

Every now and then I also get this error while trying to access the identifier or UUID property:

CADObjectGetInlineStringProperty failed fetching uniqueID for EKPersistentEvent with error Error Domain=NSMachErrorDomain Code=268435459 "The operation couldn’t be completed. (Mach error 268435459 - (ipc/send) invalid destination port)"

我已经在这个问题上坚持了很长一段时间,但认为它与iOS5 beta有关。但由于我们现在处于iOS5,它仍然无法正常工作。

I've been stuck on this problem for quite some time now, but figured it would be iOS5 beta related. But since we're now at iOS5, it's still not working.

推荐答案

在我的应用程序中,我发现如果你要求eventIdentifier在获取它的eventStore被释放后返回nil。但是如果你要求eventIdentifier之前它会返回id ok。然后,您可以释放EKEventStore实例并请求标识符没有问题....似乎它需要eventStore来检索id,但我没有得到任何警告。

In my app I found out that if you ask for the eventIdentifier when the eventStore that fetched it has been released, it returns nil. But if you ask for the eventIdentifier before it will return the id ok. You can then release the EKEventStore instance and ask for the identifier with no problem.... Seems that it needs the eventStore to retrieve the id, but I get no warnings.

这篇关于EKEvent eventIdentifier返回null的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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