Thursday, December 31, 2015

iOS ABAddressbook concepts a few notes

Properties: There are two kind of properties single value and multi value. Multi value properties contains data that can have multiple values. 
Multi value properties can either be mutable or unmutable. 

Following is example to get the single value property 

ABRecordRef personRef = ABPersonCreate();
CFErrorRef anError = NULL;
bool didSet;

didSet = ABRecordSetValue(aRecord,kABPersonFirstNameProperty,CFSTR(“Katie”), &anErr);
CFStringRef firstName = ABRecordCopyValue(aRecord,kABPersonFirstNameProperty);
CFRelease(firstName); 

Multi Value Properties 

MultiValue properties consist of list of values. Each value has a text label and an identifier associated with it. There can be more than one value with the same label, but the identifier is always unique. There are constants defined for some commonly used text labels. For e.g. Phone number of a person can be many. 


REferences:


https://developer.apple.com/library/prerelease/ios/documentation/ContactData/Conceptual/AddressBookProgrammingGuideforiPhone/Chapters/BasicObjects.html#//apple_ref/doc/uid/TP40007744-CH3-SW1

No comments:

Post a Comment