我正在使用predicateForEventsWithStartDate:endDate:calendars
查找在给定的24小时内发生的所有事件。我希望当天发生任何 Activity 的所有 Activity 。我正在努力处理跨越多天的事件-即从“晚上10点”开始到第二天2点结束。
谓词查询在执行搜索时似乎仅考虑日历事件的开始日期。它向我显示了在指定时间开始(然后在此之后结束)的事件,但没有显示在该时间段之前开始但随后泄漏到事件中的事件。
我可以早些设置开始日期,然后删除今天开始之前结束的事件。
苹果文档并不是特别有见地:
(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.
最佳答案
这些链接可以为您提供一些帮助
Fetch all events from EventStore EventKit iOS
http://developer.apple.com/library/ios/#documentation/DataManagement/Conceptual/EventKitProgGuide/ReadingAndWritingEvents.html
关于ios - 使用predicateForEventsWithStartDate:endDate:calendars方法查找EKEvents,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17418221/