0
모든 캘린더 (집, 직장, 캘린더 및 생일)에서 일정을 가져오고 싶습니다. defaultcalendar에서 이벤트를 가져 오지만 생일 캘린더에서 이벤트를 가져올 수 없습니다. 어떤 도움이 될 것입니다.모든 EKCalendar에서 이벤트 가져 오기
모든 캘린더 (집, 직장, 캘린더 및 생일)에서 일정을 가져오고 싶습니다. defaultcalendar에서 이벤트를 가져 오지만 생일 캘린더에서 이벤트를 가져올 수 없습니다. 어떤 도움이 될 것입니다.모든 EKCalendar에서 이벤트 가져 오기
This answer 당신을 도울 수 있습니다
NSDate* endDate = [NSDate dateWithTimeIntervalSinceNow:[[NSDate distantFuture] timeIntervalSinceReferenceDate]];
NSArray *calendarArray = [NSArray arrayWithObject:cal];
NSPredicate *fetchCalendarEvents = [eventStore predicateForEventsWithStartDate:[NSDate date] endDate:endDate calendars:calendarArray];
NSArray *eventList = [eventStore eventsMatchingPredicate:fetchCalendarEvents];
for(int i=0; i < eventList.count; i++){
NSLog(@"Event Title:%@", [[eventList objectAtIndex:i] title]);
}