Ios Can';t从ekstore查询日历中的提醒

Ios Can';t从ekstore查询日历中的提醒,ios,calendar,ios6,reminders,ekeventkit,Ios,Calendar,Ios6,Reminders,Ekeventkit,我正试图从日历中获取提醒列表,但不断出现错误。我可以在日历事件上做类似的事情,但当我尝试修改它来提醒时,我会遇到问题。 此代码在与ekentimymaskreminder相关的第一行失败 _store = [[EKEventStore alloc] initWithAccessToEntityTypes:EKEntityMaskReminder]; EKCalendar *calendar = [_store calendarWithIdentifier:[self.det

我正试图从日历中获取提醒列表,但不断出现错误。我可以在日历事件上做类似的事情,但当我尝试修改它来提醒时,我会遇到问题。
此代码在与ekentimymaskreminder相关的第一行失败

   _store = [[EKEventStore alloc] initWithAccessToEntityTypes:EKEntityMaskReminder];
        EKCalendar *calendar = [_store calendarWithIdentifier:[self.detailItem valueForKey:@"cal_id"]];
    NSArray *calendarArray = [NSArray arrayWithObject:calendar];
    NSPredicate *predicate = [_store predicateForRemindersInCalendars:calendarArray];
    _eventsList = [_store fetchRemindersMatchingPredicate:predicate completion:nil];
错误消息是:

-[EKEventStore initWithAccessToEntityTypes:]:发送到实例0x157660的选择器无法识别

如果我这样改变商店:

_store = [[EKEventStore alloc] init];
然后,它失败了:

如果我将商店设置为:

_store = [[EKEventStore alloc] init];
它会显示在提醒应用程序中


有人知道我为什么不能查询这些提醒吗?

您遇到错误的两个选择器都从iOS 6开始可用。如果您试图针对beta OS/库以外的其他对象运行程序,它将失败


(非常奇怪的是,
initWithAccessToEntityTypes
在iOS 5.1文档中是推荐的,尽管没有方法描述。)

谢谢,我很高兴这就是原因。我只是不明白它可能是什么。我假设你是在构建iOS 6,否则编译器应该在你走到这一步之前就抱怨了。
_store = [[EKEventStore alloc] init];