开发者

MFMailComposeViewController isn't let the user input an email

开发者 https://www.devze.com 2023-01-01 05:18 出处:网络
I\'ve configured a simple MFMailComposeViewController below. If I populate the setToRecipients, everything works fine, the email is sent. If I do not populate the setToRecipients, the mail composer wi

I've configured a simple MFMailComposeViewController below. If I populate the setToRecipients, everything works fine, the email is sent. If I do not populate the setToRecipients, the mail composer window pops up but all fields remain non-editable.

I thought the MFMailComposeViewController would allow the user to edit the email before sending? Is this possible using the standard controls?

- (IBAction) sendEmail
{
    MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
    picker.mailComposeDelegate = self;

    [picker setSubject:[NSString stringWithFormat:@"Receipt Email - %@",[self.labelDate开发者_运维技巧 text]]];

    NSString *emailBody = @"This is the message body";

    [picker setMessageBody:emailBody isHTML:NO];

    [self presentModalViewController:picker animated:YES];
    [picker release];   
}


Never mind guys.... I hadn't resigned first responder of the parent view >.< Resolved by adding [self.parentViewController resignFirstResponder]; [self becomeFirstResponder];

0

精彩评论

暂无评论...
验证码 换一张
取 消