Syncing with Address Book: Last modified property in ABPerson/ABRecord

Posted by Oliver on Stack Overflow See other posts from Stack Overflow or by Oliver
Published on 2010-04-24T22:40:48Z Indexed on 2010/04/24 22:43 UTC
Read the original article Hit count: 295

I'm syncing data from the Address Book into a Core Data database and I've nearly got it working perfectly. The only issue remaining is checking for changes and modifications on startup and reflecting the changes inside Core Data.

Currently, I simply check the ID of each ABRecord and see if it is already in Core Data. Of course, this only works in the case of new contacts and not changed information inside an existing contact. One solution would be to go through each contact already in the database and check each property against the Address Book. The down side of this is that it's really slow.

One method that would work is if the ABRecord had a last modified date. I could then store the date inside the Core Data database and check on startup to see if I need to update the contact. However, I can't find anything like this in the documentation. Any ideas?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about core-data