从 iOS MFMessageComposeViewController,可以用来发短信。
用法:
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];
Obviously, you need to first import the MessageUI.framework
: Right click on the name of your app in "Groups & Files" and choose Add > Existing Frameworks....
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>
{
// ...