I should retrieve/extract all the available properties of an ABPerson. The official documentation for IOS ABPerson Don't include the MACOS available method [ABPerson properties]
What can i do?
I should retrieve/extract all the available properties of an ABPerson. The official documentation for IOS ABPerson Don't include the MACOS available method [ABPerson properties]
What can i do?
Say you have an ABPerson
called myFriend
. You can access its first name by:
NSString* firstName = (__bridge_transfer NSString*)ABRecordCopyValue(myFriend, kABPersonFirstNameProperty);
Of course, you can replace kABPersonFirstNameProperty
with other property constants to get other properties.
Here are some of them:
kABPersonFirstNameProperty
kABPersonLastNameProperty
kABPersonMiddleNameProperty
kABPersonPrefixProperty
kABPersonSuffixProperty
kABPersonNicknameProperty
kABPersonFirstNamePhoneticProperty
ckABPersonLastNamePhoneticProperty
kABPersonMiddleNamePhoneticProperty
kABPersonOrganizationProperty
kABPersonJobTitleProperty
kABPersonDepartmentProperty
kABPersonEmailProperty
kABPersonBirthdayProperty
kABPersonNoteProperty
kABPersonCreationDateProperty
kABPersonModificationDateProperty
More about ABPerson: https://developer.apple.com/library/ios/documentation/AddressBook/Reference/ABPersonRef_iPhoneOS/#//apple_ref/doc/constant_group/Personal_Information_Properties
You could create an NSArray/NSSet with all the properties found in the ABPerson reference under the Personal Information Properties header.
Then just use a for-in to go through the NSArray like so.