iOS / Xcode:使用predicateForEventsWithStartDate以及在搜索范围之外的startDate和endDate找不到重复事件

时间:2012-09-05 18:30:01

标签: ios xcode ekevent

在iOS中,事件由startDate和endDate及其重复规则存储。 如果我想在接下来的3天内获取所有事件,我只会在接下来的三天内获得具有开始日期的事件。 但是:我没有获得重复出现的事件,并且他们的startDate不在我的搜索范围内,我想原因是iOS日历在事件发生的所有日子都在运行,但在搜索时不使用此信息在EKEventStore中的programmaticaly。

因此,当他们的startDate超出范围并且应用了一些重复规则时,有没有办法在我的“搜索日期框架”内查找重复事件?

最好的问候, 基督教

NSDate *date_today = [self dateAtBeginningOfDayForDate:[NSDate date]];
NSDate *endDate = [self dateByAddingDays:3 toDate:date_today];

NSPredicate *searchPredicate = [eventStore predicateForEventsWithStartDate:date_today
                                          endDate:endDate calendars:nil];
NSArray *events = [eventStore eventsMatchingPredicate:searchPredicate];

0 个答案:

没有答案
相关问题