1
我想在下面地址簿 - 链接联系人
-(BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier {
if (property==kABPersonEmailProperty) {
ABMultiValueRef emails = ABRecordCopyValue(person, kABPersonEmailProperty);
if (ABMultiValueGetCount(emails) > 0) {
NSString *email = (__bridge_transfer NSString*)
ABMultiValueCopyValueAtIndex(emails, ABMultiValueGetIndexForIdentifier(emails,identifier));
[recipientEmail setText:email];
[peoplePicker dismissViewControllerAnimated:YES completion:nil];
}
CFRelease(emails);
}
return NO;
}
提到的委托回调来获取选定的电子邮件属性,但如果我选择链接联系人的电子邮件属性(有单独的电子邮件)的选择电子邮件,我得到的标识符作为0,因此我得到主要联系人的第一个电子邮件ID。 如:约翰 - [email protected] [email protected] 罗杰(链接联系人) - [email protected]
当我选择[email protected]我得到[email protected]。