I have an application that adds Contacts to the Address Book in iOS, and all I need is to store the ABRecordID or ABRecordref as soon as I save the contact.
ABAddressBookAddRecord(addressbook, newPerson, &theerror);
ABAddressBookSave(addressbook, &theerror);
This question is extremely similar, but I don't understand the answer: ABRecordID for a record in addressbook(unique id for inserted record in addressbook)
How do you know the
ABRecordID ABRecordGetRecordID (
ABRecordRef newPerson
);
Some help here would be fantastic - thanks!
Simply call ABRecordGetRecordID(newPerson)
after you've saved the address book (before that, there won't be a valid ID).
//...
ABRecordID recordID = ABRecordGetRecordID(newPerson);
An ABRecordID
is the same as an int_32
(a 32-bit integer).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With