EKEventStore authorizationStatusForEntityType:无法识别?

Joh*_*ham 0 ios ekeventstore

我正在尝试使用以下方法检查我的应用是否被授予访问用户提醒的权限:

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

EKAuthorizationStatus status = [store authorizationStatusForEntityType:EKEntityTypeReminder];
Run Code Online (Sandbox Code Playgroud)

但Xcode表示,'authorizationStatusForEntityType:'没有可见的@interface,当有明显存在时.是什么让它做到这一点,我该如何解决它?(这不是一个私人方法,它在文档中 ......)

PS.我已经重新启动了Xcode和我的Mac,清理了项目和一切......

The*_*ken 5

你不需要EKEventStore变量.只需使用:

EKAuthorizationStatus status = [EKEventStore authorizationStatusForEntityType:EKEntityTypeReminder];
Run Code Online (Sandbox Code Playgroud)

authorizationStatusForEntityType:是一种静态方法; 你不需要一个自变量.