I really need some help here.
I do exactly the same as in all the examples, but don't get any notification.
Here's my code:
#import <AddressBook/ABAddressBook.h>
#import <AddressBook/AddressBook.h>
Registering for notification:
ABAddressBookRef book = ABAddressBookCreate();
ABAddressBookRegisterExternalChangeCallback(book, addressBookChanged, self);
Definition of the callback:
void addressBookChanged(ABAddressBookRef reference,
CFDictionaryRef dictionary,
void *context)
{
ViewController *viewController = (ViewController*)context;
[viewController addressBookChanged];
}
And another method:
-(void) addressBookChanged
{
NSLog(@"%@", @"addressBookChanged");
}
What am I doing wrong here?
Any help will be appreciated. Thanks.
Ok, I know the answer now...
The callback is being invoked, but only when I resume back my application.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With