Search code examples
ios6abaddressbook

iOS6 Add some additional information to ABAdressbook


I need to know if card of current person in address book was changed from my application.

My best idea to accomplish this is to save some data or property inside ABAddressbook.

How can I save some additional data in iOS 6 in a person's card?


Solution

  • iOS provides no facility for storing extra data in the Address Book.

    The most straightforward way for keeping extra contact-related data is to store it in your app, using the RecordID of the ABPerson record. However, be warned that those identifiers can disappear (if a record is deleted from the AddressBook) or even change (if the use changes the synchronization configuration e.g. for iCloud). If you really need to keep extra data matched up with ABPerson records then you can grab a copy of the CompositeName property (this is a derived value constructed from first name, last name etc) and then if your cached RecordID lookup fails, then hunt for a record with a matching CompositeName.

    If all you want to do is just determine if an ABPerson record has changed, then perhaps it would be sufficient to just cache a value for ModificationDateProperty and compare that to the new value?