【发布时间】:2013-07-02 05:48:47
【问题描述】:
我正在使用predicateForEventsWithStartDate:endDate:calendars 查找在给定 24 小时内发生的所有事件。我想要在这一天发生任何部分事件的所有事件。我正在努力处理跨越多天的事件 - 即从晚上 10 点开始,到“第二天”凌晨 2 点结束。
谓词查询在执行搜索时似乎只考虑日历事件的开始日期。它向我显示了在我指定的时间开始(然后结束)的事件,但不显示在该时间段之前开始但随后泄漏到其中的事件。
我可以提前设置开始日期,然后删除在今天开始之前结束的事件。
Apple Docs 不是特别有洞察力:
(NSPredicate *)predicateForEventsWithStartDate:(NSDate *)startDate endDate:(NSDate *)endDate calendars:(NSArray *)calendars
startDate: // The start date of the range of events fetched.
endDate: // The end date of the range of events fetched.
【问题讨论】:
标签: ios objective-c xcode ekeventkit ekeventstore