Contacts framework crashing in simulator?

I am trying to run a very basic app on iOS10 with Xcode8 in the simulator. Everytime I make the call to authorize access to Contacts, it crashes the app immediately, and without stopping in the debugger. I dont see my app listed in the privacy permissions after this. Here is the code I use to request access to Contacts:


CNContactStore *store = [[CNContactStore alloc] init];
[store requestAccessForEntityType:CNEntityTypeContacts completionHandler:^(BOOL granted, NSError * __nullable error) {



Pretty basic. Is this a known issue? Has anyone else run into this?

Accepted Reply

add

==

Privacy - Contacts Usage Description

==

to your info.plist

Replies

CNContactStore

This does look pretty basic and appears to work on iOS 9. Are you hanging onto the store in a strong property after this code runs? I don't know if this is the issue but just from these 2 lines of code looks a little suspicious. If you aren't able to figure out what's going on, you should write a bug against iOS 10 with a sample project attached.

add

==

Privacy - Contacts Usage Description

==

to your info.plist

Thanks. That fixed it!! Xcode should flag this instead of just breaking out of the debugger though ... will file a radar