October 2013
Intermediate to advanced
1053 pages
28h 7m
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:
-(void)enumerateTodayEventsInStore:(EKEventStore*)paramStorecalendar:(EKCalendar*)paramCalendar{/* Construct the starting date for today */NSDate*startDate=[NSDatedate];/* The end date will be 1 day from now */NSTimeIntervalNSOneDay=1*24*60*60;NSDate*endDate=[startDatedateByAddingTimeInterval:NSOneDay];/* Create the predicate that we can later pass tothe event store in order to fetch the events */NSPredicate*searchPredicate=[paramStorepredicateForEventsWithStartDate:startDateendDate:endDatecalendars:@[paramCalendar]];/* Make sure we succeeded in creating the predicate */if(searchPredicate==nil){NSLog(@"Could not create the search predicate.");return;}/* Fetch all the events that fall between thestarting and the ending dates */NSArray*events=[paramStoreeventsMatchingPredicate:searchPredicate];/* Array of NSString equivalents of the valuesin the EKParticipantRole enumeration */NSArray*attendeeRole=@[@"Unknown",@"Required",@"Optional",@"Chair",@"Non Participant",];/* Array ...
Read now
Unlock full access