initWithAccessToEntityTypes:
is deprecated in OS X 10.9 because OS X 10.9 introduced security features similar to those introduced in iOS 6. That is, on OS X 10.9 you have to request permission to use the EventKit APIs before you can actually interact with the events. You do so by using the method -[EKEventStore requestAccessToEntityType:completion:]
.
So the code you would want to use would look something like:
EKEventStore *eventStore = [[EKEventStore alloc] init];
[eventStore requestAccessToEntityType:EKEntityTypeEvent completion:^(BOOL granted, NSError *error) {
dispatch_async(dispatch_get_main_queue(), ^{
// Event creation code here.
});
}];
The dispatch to the main queue is because the event store completion callback can happen on an arbitrary queue. You can read the docs on it here.
Note that -[EKEventStore requestAccessToEntityType:completion:]
only started being available on OS X 10.9, so if you need to support 10.8 you're going to have do some version checking to decide whether or not you need to request permissions.