Take a look at the MessageComposer Sample App and the MFMessageComposeViewController Class.
You then do something like this, though you should first check whether the MFMessageComposeViewController
is actually available on your device (See the MessageComposer Sample):
MFMessageComposeViewController *picker = [[MFMessageComposeViewController alloc] init];
picker.messageComposeDelegate = self;
picker.recipients = [NSArray arrayWithObjects:@"1234", @"2345", nil];
picker.body = yourTextField.text
[self presentModalViewController:picker animated:YES];
[picker release];
You need to first import the MessageUI.framework
(see this answer).
Import it into your classes via #import <MessageUI/MessageUI.h>
and add <MFMessageComposeViewControllerDelegate>
in the .h file, e.g. like so:
#import <UIKit/UIKit.h>
#import <MessageUI/MessageUI.h>
@interface YourClass : UIViewController <MFMessageComposeViewControllerDelegate>
{
// ...