我的代码中显然遗漏了一些东西,因为每当我尝试按“发送”或“取消”时,应用程序都会崩溃。另外,我有一个固定的主题和收件人,但如果我尝试编辑它们,应用程序就会崩溃。任何帮助,将不胜感激。这是我当前与 MFMailComposeViewController 相关的代码:
MFMailComposeViewController *controller = [[[MFMailComposeViewController alloc] init] autorelease];
controller.hidesBottomBarWhenPushed = YES;
controller.mailComposeDelegate = self;
[controller setToRecipients:[NSArray arrayWithObject:@"BSCApp@ymail.com"]];
[controller setSubject:@"My Subject"];
if (controller) [self presentModalViewController:controller animated:YES];
[controller release];
和...
- (void)mailComposeController:(MFMailComposeViewController*)controller
didFinishWithResult:(MFMailComposeResult)result
error:(NSError*)error;
{
if (result == MFMailComposeResultSent) {
NSLog(@"It's away!");
}
[self dismissModalViewControllerAnimated:YES];
}
提前致谢。