creating instance of CNContactStore blows up debugger

NBCruzNBCruz USMember ✭✭
edited October 2016 in Xamarin.iOS

I'm saving a contact into the Contacts database using the new API in iOS 9 and copied code from Xamarin iOS Documentation. Here is my code:

        CNContactStore store = new CNContactStore();
        if (store != null)
            CNSaveRequest saveRequest = new CNSaveRequest();
            if (saveRequest != null)
                saveRequest.AddContact(contact, store.DefaultContainerIdentifier);


It blows up at the first line of code. With the simulator, it runs fine. However, I noticed in the simulator, if I pause in debug mode to highlight the 'store' variable, the debugger starts evaluating then blows up as well.

I checked the Restrictions section in the actual device and Restrictions is on but Allow Changes is checked in the Contacts section.

The iOS version on the phone is 10.0.2 and on the sim it's 9.3

Sign In or Register to comment.