ABAddressBookCreate deprecated

后端 未结 2 1735
独厮守ぢ
独厮守ぢ 2020-12-28 21:27

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.

2条回答
  •  伪装坚强ぢ
    2020-12-28 21:51

    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

提交回复
热议问题