gpt4 book ai didi

iphone - 在 iOS 的邮件编辑器中设置收件人字段的问题

转载 作者:行者123 更新时间:2023-11-29 13:13:43 25 4
gpt4 key购买 nike

我正在使用此代码通过单击按钮发送电子邮件:

   -(IBAction)btn_emailClick:(id)sender{
// checking for the blank Email id field.
if ([[patientDemogDic valueForKey:@"email"] isEqualToString:@""]){

}
else{

if([MFMailComposeViewController canSendMail]){

MFMailComposeViewController * mailer = [[MFMailComposeViewController alloc] init];
mailer.mailComposeDelegate = self;
[mailer setSubject:@""];
NSArray * toRecipients = [NSArray arrayWithObjects:[btn_emailClick currentTitle],
nil];
[mailer setToRecipients:toRecipients];
NSString *emailBody = @"";
[mailer setMessageBody:emailBody isHTML:NO];
mailer.navigationBar.barStyle = UIBarStyleBlackOpaque;
[self presentViewController:mailer animated:YES completion:Nil];
}
else{

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Failure" message:@"Your
device doesn't support the composer sheet" delegate:self
cancelButtonTitle:@"OK"otherButtonTitles:nil];
[alert show];
}
}
}

一切正常,但只要电子邮件地址是这样的:- nupur_Pal.iwalMeditab,.<>{}[]!#$%^&*_@meditab.com 电子邮件编辑器屏幕中的“收件人”字段未显示此电子邮件地址。我已经调试了好几次,但找不到正确的原因。

最佳答案

制作 IBOutlet 用于电子邮件 UIButton

然后尝试下面的代码

   NSArray * toRecipients = [NSArray arrayWithObjects:emailButton.titleLabel.text,
nil];
[mailer setToRecipients:toRecipients];

关于iphone - 在 iOS 的邮件编辑器中设置收件人字段的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16437483/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com