December 2012
Intermediate to advanced
834 pages
27h
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=[[EKEventStorealloc]init];for(EKCalendar*thisCalendarineventStore.calendars){if(thisCalendar.type==EKCalendarTypeCalDAV){if([thisCalendar.titlerangeOfString:paramDescription].location!=NSNotFound){returnthisCalendar;}}}returnresult;}-(void)enumerateTodayEvents{/* Find a calendar to base our search on */EKCalendar*targetCalendar=[selfcalDAVCalendarWithTitleContaining:@"vandad.np@gmail.com"];/* If we could not find a CalDAV calendar thatwe 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 calendarsto the event store to search */NSArray*targetCalendars=[[NSArrayalloc]initWithObjects:targetCalendar,nil];/* Instantiate the event store */EKEventStore*eventStore=[[EKEventStorealloc]init];/* Construct the starting date for today */NSDate
Read now
Unlock full access