iOS - 从自定义日历中获取事件

时间:2015-08-10 06:35:14

标签: ios objective-c calendar ekeventstore ekcalendar

以下是我用来从日历中获取事件的代码,但我总是得到数组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];

如何从自定义日历中获取所有活动?

0 个答案:

没有答案