user6631314
user6631314

Reputation: 1958

IOS/Xcode: Crash due to lack of plist key for calendars not responding to adding keys

I am trying to run a tutorial on EventKit. The tutorial was written before Apple required you to include plist keys for privacy-sensitive things like accessing a calendar so I got the error in Xcode:

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.

Accordingly, I went to the plist file and added keys for both calendar and reminders as shown here:

enter image description here

The source code now includes the following keys:

<key>NSRemindersUsageDescription</key>
    <string>Reminders</string>
    <key>NSCalendarsUsageDescription</key>
    <string>Calendars</string>

I also deleted the project from the simulator, cleaned it and reloaded. However, I am still getting the original error. Is there anything else I can try?

Thanks in advance for any suggestions

Upvotes: 1

Views: 454

Answers (1)

LorenzOliveto
LorenzOliveto

Reputation: 7936

I think that you are editing the wrong Info.plist file. You should edit the Info.plist file of your main target (should be called EventKitDemo-Info.plist). From your screenshot it seems that you're editing the Info.plist of the test target.

Upvotes: 2

Related Questions