我已使用MFmailComposer实现发送电子邮件代码...
它很精细,但问题出在选择收件人的电子邮件地址 。
我想从通讯录联系人处获取电子邮件地址。
如何检索这个任何帮助
我已为其提供的联系人实施了ABPeoplePickerNavigationController委托方法
- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker
shouldContinueAfterSelectingPerson:(ABRecordRef)person
property:(ABPropertyID)property
identifier:(ABMultiValueIdentifier)identifier
{
if (property == kABPersonPhoneProperty)
{
ABMultiValueRef emails = ABRecordCopyValue(person, property);
CFStringRef phonenumberselected = ABMultiValueCopyValueAtIndex(emails, identifier);
CFStringRef emailLabelSelected = ABMultiValueCopyLabelAtIndex(emails, identifier);
CFStringRef emailLabelSelectedLocalized = ABAddressBookCopyLocalizedLabel(ABMultiValueCopyLabelAtIndex(emails, identifier));
NSLog(@"\n EmailValueSelected = %@ \n EmailLabelSelected = %@ \n \EmailLabeSelectedlLocalized = %@", phonenumberselected, emailLabelSelected, emailLabelSelectedLocalized);
recipientField.text = (NSString *)emails; //Crashes but accepts 'phonenumberselected'
NSLog(@" emails###:%@... phonenumberselected%@... emailLabelSelected %@.... emailLabelSelectedLocalized %@")
//emails###: ABMultiValueRef 0x80b7bc0 with 1 value(s) //**Log output Displyas like this**
[ self dismissModalViewControllerAnimated:YES ];
return NO;
}
return YES;
的 How to write code to pick the selected EMail address from phone book
的