Search code examples
iosekeventstore

EKEventStore authorizationStatusForEntityType: not recognized?


I'm trying to check if my app was granted access to the user's Reminders by using:

EKEventStore *store = [[EKEventStore alloc] init];

EKAuthorizationStatus status = [store authorizationStatusForEntityType:EKEntityTypeReminder];

But Xcode says there is no visible @interface for 'authorizationStatusForEntityType:', when clearly there is. What's making it do this and how can I fix it? (it's not like this is a private method, it's in the docs...)

PS. I've already restarted Xcode and my Mac, cleaned the project and everything...


Solution

  • You don't need the EKEventStore variable. Just use:

    EKAuthorizationStatus status = [EKEventStore authorizationStatusForEntityType:EKEntityTypeReminder];
    

    authorizationStatusForEntityType: is a static method; you don't need an independent variable.