[英]Mail Compose module stopped working in ios6
我有一個不久前構建的應用程序,該應用程序使用郵件撰寫模塊並且可以運行,但是,一旦我升級到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];
}
有誰知道是什么原因導致它破裂?
嘗試添加此語句。
composer.wantsFullScreenLayout = YES;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.