I have a contact with linked contacts. So when I show this contact with ABPersonViewController is has original emails and emails from linked contacts.

When I select linked email ([email protected]) then delegate method calls:
- (BOOL)personViewController:(ABPersonViewController *)personViewController shouldPerformDefaultActionForPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier
{
//get selected phone number
ABMultiValueRef multi = ABRecordCopyValue(person, property);
CFIndex index = ABMultiValueGetIndexForIdentifier(multi, identifier);
NSString *selectedContactData = (__bridge_transfer NSString *)ABMultiValueCopyValueAtIndex(multi, index);
return NO;
}
But in selectedContactData I get not selected email, but first one. I have this problem only with combined contacts.
Is there a proper way to choose email from contact with connected contacts?
The only way I can imagine the behavior you describe is that you might be referencing a
ABRecordRefin some property or ivar that you populated when you first populateddisplayedPersonproperty for theABPersonViewController. Clearly, in this code snippet you are correctly using thepersonproperty that was passed to this delegate method, but perhaps you simplified the code snippet when sharing it with us? When I use your code snippet withshouldShowLinkedPeopleturned on, it works fine for me for a linked contact's properties.If you're sure you don't have an issue with using the wrong
ABRecordRefvariable, the only other possibility I can imagine is that I have experienced strange behavior using the default contacts that are provided on the simulator. I might suggest trying this on an actual device with real linked contacts.