问题与calendarItemsWithExternalIdentifier没有想到它有访问实体类型

问题描述:

我想检索日历条目使用外部日历ID。我这样做与目标的Mac应用程序设置为10.11使用的Xcode 7.1和代码是斯威夫特2问题与calendarItemsWithExternalIdentifier没有想到它有访问实体类型

当我调用下面的代码

let myItems = myEventStore.calendarItemsWithExternalIdentifier(searchString) 

我得到的调试输出以下消息

2015-11-04 12:40:03.504 EvesCRM[1447:132129] ERROR: Request access to specific EventKit entity types before attempting to retrieve EventKit objects. 2015-11-04 12:40:03.504 EvesCRM[1447:132129] ERROR: Request access to specific EventKit entity types before attempting to retrieve EventKit objects.

我检查了事件存储已授权事件和提醒事件类型,并且在调用命令之前立即执行了此检查,并且他们已连接并报告该访问被授予。对同一事件库的所有其他调用都按预期工作,它似乎只是这个特定函数没有检测到实体类型。

我已经搜索了过去一天的解决方案,但无法找到任何可以帮助我移动病房的东西。希望有人能指出我正确的方向来解决这个问题。

我有同样的问题,并通过调用总是requestAccessToEntityType:completion:,而不是只检查与authorizationStatusForEntityType:

+0

由于状态解决它,这是它! –