以下是我用来从日历中获取事件的代码,但我总是得到数组nil
。
EKEventStore *eventStore = AppContext.HSCalendar.eventStore;
NSPredicate *predicate = [eventStore predicateForEventsWithStartDate:[NSDate distantPast] endDate:[NSDate distantFuture] calendars:[NSArray arrayWithObject:[eventStore calendarWithIdentifier:AppContext.HSCalendar.selectedCalendarID]]];
NSArray *arrEvent = [eventStore eventsMatchingPredicate:predicate];
如何从自定义日历中获取所有活动?