簡體   English   中英

郵件撰寫模塊在ios6中停止工作

[英]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;

請檢查以下鏈接:-

  1. 教程

完成此操作后,請不要忘記在iPhone 5的“ Settings中設置您的帳戶。請添加您的郵件帳戶。 如果仍然遇到任何問題,這將起作用並恢復我的狀態。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM