Showing a person picker with ABPeoplePickerNavigationController
, I can get the address of the selected person in a dictionary with this:
- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier {
if (property == kABPersonAddressProperty) {
ABMultiValueRef addressMultiValue = ABRecordCopyValue(person, kABPersonAddressProperty);
NSDictionary *address = (NSDictionary *)CFBridgingRelease(ABMultiValueCopyValueAtIndex(addressMultiValue, ABMultiValueGetIndexForIdentifier(addressMultiValue, identifier)));
}
[self dismissModalViewControllerAnimated:YES];
return NO;
}
Depending on the country, the convention on how to format this address is not the same.
Is there a way to get the string of the address as displayed by the picker (similar to what Contacts.app shows)?