It turns out that the kABPerson*Property
"constants" are actually initialized on the first call to ABAddressBookCreate
. Before that the values are all zero. Here is some sample code:
NSLog(@"Before AddressBook Create, kABPersonLastNameProperty = %d", kABPersonLastNameProperty);
ABAddressBookRef store = ABAddressBookCreateWithOptions(NULL, NULL);
NSLog(@"After AddressBook Create, kABPersonLastNameProperty = %d", kABPersonLastNameProperty);
If you haven't accessed the address book before, you would see output like:
Before AddressBook Create, kABPersonLastNameProperty = 0
After AddressBook Create, kABPersonLastNameProperty = 1
I
Other calls may initialize the constants as well but from my exploration a call to ABAddressBookGetAuthorizationStatus
is not sufficient.