February 2012
Intermediate to advanced
872 pages
22h 43m
English
You want to retrieve the list of attendees for a specific event.
Use the attendees property of
an instance of EKEvent. This
property is of type NSArray and
includes objects of type EKParticipant.
The example code that follows will retrieve all the events that happen today (whatever the day may be) and print out useful event information, including the attendees of that event, to the console window:
- (EKCalendar *) calDAVCalendarWithTitleContaining :(NSString *)paramDescription{ EKCalendar *result = nil; EKEventStore *eventStore = [[EKEventStore alloc] init]; for (EKCalendar *thisCalendar in eventStore.calendars){ if (thisCalendar.type == EKCalendarTypeCalDAV){ if ([thisCalendar.title rangeOfString:paramDescription].location != NSNotFound){ return thisCalendar; } } } return result; } - (void) enumerateTodayEvents{ /* Find a calendar to base our search on */ EKCalendar *targetCalendar = [self calDAVCalendarWithTitleContaining:@"vandad.np@gmail.com"]; /* If we could not find a CalDAV calendar that we were looking for, then we will abort the operation */ if (targetCalendar == nil){ NSLog(@"No CalDAV calendars were found."); return; } /* We have to pass an array of calendars to the event store to search */ NSArray *targetCalendars = [[NSArray alloc] initWithObjects:targetCalendar, nil]; /* Instantiate the event store */ EKEventStore *eventStore = [[EKEventStore alloc] init]; /* Construct the starting date for today */ NSDate *startDate ...Read now
Unlock full access