1

我试图从一个确定的 中获取所有事件EKCalendar,但是如果我eventsMatching Predicate:使用生成的谓词predicateForEventsWithStartDate:endDate:calendars:和过去的 ' startDate' 调用,我会得到一个空对象。这是一个错误?还是我无法找回过去的事件?

编辑(NSData 声明):

[[self eventStore] predicateForEventsWithStartDate:[NSDate distantPast] endDate:[NSDate distantFuture] calendars:syncedCalendars]
4

1 回答 1

0

尝试将您的代码更改为:

    NSDate* futureDate =  [NSDate dateWithTimeIntervalSinceNow:[[NSDate distantFuture] timeIntervalSinceReferenceDate]];
    [[self eventStore] predicateForEventsWithStartDate:[NSDate date] endDate: futureDate calendars:syncedCalendars]

还要确保您的 syncedCalendars 是 NSArray 类型。

于 2013-12-05T11:37:32.540 回答