views:

56

answers:

1

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

A: 

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.
rekle