iosaddressbookui

ABRecordRef store value that is not visible to the user?


I am working on an app that uses the iOS Address book.

I am wondering if there is a way to store a value of some kind in a ABRecordRef (so a contact card) that the user can't see. I would like to do that to use that value as a reference around my app.

Is there a way to do so?


Solution

  • AddressBook doesn't allow for storing custom metadata in the store itself for an ABRecordRef. However, an ABRecordRef does have an ABRecordID property that you can use to correlate information that is useful to your own application. You could stuff these IDs in CoreData, a property list, or even user defaults so that you can match your metadata up with a specific address book contact.