开发者

How can I send an email from app of the screen or text portions of the screen

Hi I’m kind of New to iPhone development and I want use MFMailComposeViewController, to take the text/notes which are in two text views one editable the other is not, that are on the screen开发者_运维技巧 and have them automatically applied to the subject portion of an email, is this possible and if so how would I implement it. Thank for any and all help you can provide. Chris


First, get the text from your two text views and store them into NSStrings, then use the setSubject method of the MFMailComposeViewController. i.e.

NSString *text1 = textView.text;
NSString *text2 = textView2.text;
MFMailComposeViewController *controller = [[MFMailComposeViewController alloc] init];
NSString *subject = [NSString stringWithFormat:@"%@ %@", text1, text2];
[controller setSubject:subject];
// Display the controller.
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜