开发者

MFMailComposeViewController isn't let the user input an email

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜