Sync Services With AddressBook

Posted by Marcus on Stack Overflow See other posts from Stack Overflow or by Marcus
Published on 2010-04-22T15:32:37Z Indexed on 2010/04/22 15:33 UTC
Read the original article Hit count: 369

Hi,

I've developed an application to sync the Mac address book with another application. I was using an NSNotification (kABDatabaseChangedExternallyNotification) which are sent every time the address book is edited to do the syncing.
However I found that if I 'overloaded' the address book (by adding 20 records really quickly or something) I didn't get all of the notifications. I have since found the Sync Services framework which seems to be aimed at my kind of application and it seems to work fine.

The problem is that the changes are not 'pushed' to me in the same was as an NSNotification - I have to sync every 5 minutes or so. And, from what I can understand, I shouldn't use the AddressBook API directly but push changes back through sync services. This means that changes are not instant but lagged by how often address book/my app syncs.

Is there any way to make it instant? or to use the NSNotifications reliably?

Thanks for your time, Marc

© Stack Overflow or respective owner

Related posts about addressbook

Related posts about syncservices