以编程方式发送短信代码问题

时间:2010-08-20 19:49:49

标签: iphone uiviewcontroller

我正在编写以编程方式发送短信的代码 程序在倒数第二行崩溃。

MFMessageComposeViewController *picker = [[MFMessageComposeViewController alloc] init];
picker.messageComposeDelegate = self;
picker.recipients = [NSArray arrayWithObject:@"123456789"];   // your recipient number or self for testing

picker.body = @"test from OS4";
[self presentModalViewController:picker animated:YES];
[picker release];

1 个答案:

答案 0 :(得分:0)

我认为它可以安全地说它实现了

UIViewController <MFMessageComposeViewControllerDelegate>


在这种情况下,我建议返回http://iphonesdkdev.blogspot.com/2010/04/mfmessagecomposeviewcontroller-sample.html,复制他们的示例并从那里继续进行。