0

I want to identify the address book changes in my app using NSNotificationCenter how to use Please help me.

Karthick
  • 382
  • 1
  • 3
  • 23
  • You had accepted my answer below for a while, and then de-accepted it again. Could you please describe more precisely what your problem is? – Reinhard Männer May 15 '13 at 09:10

1 Answers1

0

I don't understand exactly what your problem is, but if you want to be notified when the address book is modified externally, you could use

CFErrorRef error = nil;
ABAddressBookRef contacts = ABAddressBookCreateWithOptions (NULL, &error);
if (contacts != nil) {
    ABAddressBookRegisterExternalChangeCallback (contacts,
                                                 addressBookChangedExternally,
                                                 (__bridge void *)(self)
                                                 );
}

which assumes that the object that implements this code (self) implements a function (not a method)

void addressBookChangedExternally(ABAddressBookRef abRef, CFDictionaryRef dicRef, void *context)
Reinhard Männer
  • 14,022
  • 5
  • 54
  • 116