EKEventStore访问请求在iOS 10上崩溃。消息:应用程序的Info.plist必须包含NSRemindersUsageDescription键

时间:2016-11-24 03:01:13

标签: ios ekeventstore

我的代码: 的

 EKEventStore* eventStore = [[EKEventStore alloc] init];
 [eventStore requestAccessToEntityType:EKEntityTypeReminder  
            completion:^(BOOL granted, NSError * _Nullable error) {

}];

的 该应用的Info.plist 已包含 NSRemindersUsageDescription 键和 NSCalendarsUsageDescription 键, 但 下面的代码在iOS 8和9上工作正常,但在iOS 10上它崩溃了.like:

  [access] This app has crashed because it attempted to access 
   privacy-sensitive data without a usage description.  
   The app's Info.plist must contain an NSCalendarsUsageDescription key 
   with a string value explaining to the user how the app uses this data.

1 个答案:

答案 0 :(得分:3)

ios10

您应该在NSRemindersUsageDescription

中添加access configuration list Info.plist

方法1)如果您在Xcode中打开info.plist,请按照以下图片:

a.click Info.plist

click Info.plist

b。点击添加按钮

click the add button

℃。设置键NSRemindersUsageDescription

set the rescribe name

d。填写您的应用需要用户此权限的值

fill the value  why your app need user’s this permission

修改

如果您在NSRemindersUsageDescription中添加Info.plist,然后显示error,则会在NSRemindersUsageDescription中添加TARGET,请尝试:

add describe in target

方法2)如果您在源代码中打开info.plist

<key>NSRemindersUsageDescription</key>
<string>the describe of your need this permissions </string>