ABAddressBookCreate deprecated

user3300758 picture user3300758 · Apr 2, 2014 · Viewed 11.1k times · Source

I'm creating an application that will save a contact to the address book, but when I use ABAddressBookCreate to my code, it appear as a warning. I'm coding in iOS 7.

My question is, what is the substitute for ABAddressBookCreate in iOS 7.

Any help will be appreciated. Thanks.

Answer

Dima picture Dima · Apr 2, 2014

Use ABAddressBookCreateWithOptions() instead.

ABAddressBookRef addressBook = ABAddressBookCreateWithOptions(NULL, NULL);

More info on usage in the documentation here

edit

The AddressBook framework is deprecated in iOS 9 and replaced with the new and improved Contacts framework: https://developer.apple.com/library/ios/documentation/Contacts/Reference/Contacts_Framework/index.html#//apple_ref/doc/uid/TP40015328