在 iOS 中,事件由它们的 startDate 和 endDate 以及它们的重复规则存储。如果我想获取接下来 3 天的所有事件,我只会在接下来的三天内获取开始日期的事件。但是:我没有收到重复发生的事件,并且它们的 startDate 不在我的搜索范围内,我想原因是 iOS 日历在事件发生的所有日子里都在动态计算,但在搜索时不使用此信息以编程方式在 EKEventStore 中。
那么当它们的 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];