For addresses, you get an array of dictionaries so that you loop through the array and extract the key value from each dictionary:
ABMultiValueRef addressProperty = ABRecordCopyValue(person, kABPersonAddressProperty); NSArray *address = (NSArray *)ABMultiValueCopyArrayOfAllValues(addressProperty); for (NSDictionary *addressDict in address) { NSString *country = [addressDict objectForKey:@"Country"]; } CFRelease(addressProperty);
You can also loop directly through ABMultiValueRef instead of first converting it to NSArray:
ABMultiValueRef addressProperty = ABRecordCopyValue(person, kABPersonAddressProperty); for (CFIndex i = 0; i < ABMultiValueGetCount(addressProperty); i++) { CFDictionaryRef dict = ABMultiValueCopyValueAtIndex(addressProperty, i); NSString *country = (NSString *)CFDictionaryGetValue(dict, kABPersonAddressCountryKey); CFRelease(dict); } CFRelease(addressProperty);
source share