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]。