Syncing with Address Book: Last modified property in ABPerson/ABRecord
- by Oliver
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?