Here is the code:
EKEventStore *store = [[EKEventStore alloc]
initWithAccessToEntityTypes:EKEntityMaskEvent];
NSArray *eventCalendars = [store calendarsForEntityType:EKEntityTypeEvent];
NSDate *monday, *sunday;
NSPredicate *predicate;
predicate = [store predicateForEventsWithStartDate:monday
endDate:sunday
calendars:eventCalendars];
NSArray *events = [store eventsMatchingPredicate:predicate];
NSLog(@"Events this week:");
for (EKEvent *event in events) {
NSLog(@"%@ - starts at %@", event.title, event.startDate);
}
I am getting an error saying “Use of undeclared identifier ‘EKEntityMaskEvent'”
and Use of undeclared identifier ‘EKEntityTypeEvent’
How do I fix this?
from http://developer.apple.com/library/mac/#documentation/EventKit/Reference/EKEventStoreClassRef/Reference/Reference.html#//apple_ref/doc/uid/TP40009567
initWithAccessToEntityTypes:is Available in OS X v10.8 and later.