Если для пользователя определено несколько адресов - рабочий, домашний и т. Д., Вам потребуется использовать атрибут идентификатора, чтобы различать их. То, к чему я пришел, взято из похожих постов на адресах электронной почты:
#pragma mark - ABPeoplePickerNavigationControllerDelegate
- (IBAction)chooseContact:(id)sender
{
ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init];
picker.peoplePickerDelegate = self;
[self presentViewController:picker animated:YES completion:nil];
// [self dismissViewControllerAnimated:YES completion:nil];
}
- (void) peoplePickerNavigationControllerDidCancel:(ABPeoplePickerNavigationController *)peoplePicker
{
[self dismissViewControllerAnimated:YES completion:nil];
}
- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker
shouldContinueAfterSelectingPerson:(ABRecordRef)person
{
return YES;
}
- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker
shouldContinueAfterSelectingPerson:(ABRecordRef)person
property:(ABPropertyID)property
identifier:(ABMultiValueIdentifier)identifier
{
if (property == kABPersonAddressProperty)
{
ABMultiValueRef addresses = ABRecordCopyValue(person, property);
CFIndex addressIndex = ABMultiValueGetIndexForIdentifier(addresses, identifier);
CFDictionaryRef address = ABMultiValueCopyValueAtIndex(addresses, addressIndex);
// create address string to lookup
NSString *street = (NSString*) CFDictionaryGetValue(address, kABPersonAddressStreetKey);
NSString *city = (NSString*) CFDictionaryGetValue(address, kABPersonAddressCityKey);
NSString *state = (NSString*) CFDictionaryGetValue(address, kABPersonAddressStateKey);
NSString *postal = (NSString*) CFDictionaryGetValue(address, kABPersonAddressZIPKey);
NSString *country = (NSString*) CFDictionaryGetValue(address, kABPersonAddressCountryKey);
CFRelease(address);
CFRelease(addresses);
[self dismissViewControllerAnimated:YES completion:nil];
return NO;
}
return YES;
}
.