我有一个我之前构建的应用程序,它使用邮件撰写模块并且工作,但是,一旦我升级到iOS6它就停止了工作。这是我的.h中的代码:
#import <UIKit/UIKit.h>
#import <MessageUi/MFMailComposeViewController.h>
@interface SecondViewController : UIViewController <MFMailComposeViewControllerDelegate>
-(IBAction)email;
@end
这是我的.m代码:
#import "SecondViewController.h"
@implementation SecondViewController
-(IBAction)telephone2 {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://01748826265"]];
}
-(IBAction)email {
MFMailComposeViewController *composer = [[MFMailComposeViewController alloc] init];
[composer setMailComposeDelegate:self];
if ([MFMailComposeViewController canSendMail]) {
[composer setToRecipients:[NSArray arrayWithObjects:@"info@pizzaprontorichmond.co.uk", nil]];
[composer setSubject:@"subject here"];
[composer setMessageBody:@"message here" isHTML:NO];
[composer setModalTransitionStyle:UIModalTransitionStyleCrossDissolve];
[self presentModalViewController:composer animated:YES];
}
[self dismissModalViewControllerAnimated:YES];
}
-(void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error {
if (error) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"error" message:[NSString stringWithFormat:@"error %@", [error description]] delegate:nil cancelButtonTitle:@"dismiss" otherButtonTitles:nil, nil];
[alert show];
}
[self dismissModalViewControllerAnimated:YES];
}
有谁知道是什么导致它破裂?