标签: mfmailcomposeviewcontroller

MFMailComposeViewController用其他语言?

MFMailComposeViewController只有英文版!?

我正在考虑使用MFMailComposeViewController处理从我的应用程序发送电子邮件的想法,但我需要它符合设置为英语以外语言的设备的语言环境.是否可以将MFMailComposeViewController设置为其他语言?即使我将设备的语言设置为日语,MFMailComposeViewController的To:,From:,Subject:,部分仍保留为英语.如何更改MFMailComposeViewController的语言?

email iphone mfmailcomposeviewcontroller

5
推荐指数
1
解决办法
3732
查看次数

无法使用MFMailComposeViewController从应用程序发送电子邮件

我正在努力尝试从我的应用发送电子邮件.我在iCodeBlog上试过这段代码(http://icodeblog.com/2009/11/18/iphone-coding-tutorial-in-application-emailing/)

-(void)sendEmail:(id)sender
{
    MFMailComposeViewController *mail = [[MFMailComposeViewController alloc] init];
    mail.mailComposeDelegate = self;
    if ([MFMailComposeViewController canSendMail]) {
            //Setting up the Subject, recipients, and message body.
        [mail setToRecipients:[NSArray arrayWithObjects:@"myEmail@email.com",nil]];
        [mail setSubject:@"Subject of Email"];
        [mail setMessageBody:@"Message of email" isHTML:NO];
            //Present the mail view controller
        [self presentModalViewController:mail animated:YES];
    }
        //release the mail
    [mail release];
}
    //This is one of the delegate methods that handles success or failure
    //and dismisses the mail
- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error
{
    [self dismissModalViewControllerAnimated:YES];
    if (result == MFMailComposeResultFailed) …

email iphone cocoa-touch mfmailcomposeviewcontroller

5
推荐指数
1
解决办法
6445
查看次数

MFMailComposeViewController应用程序在ipad中崩溃

我在MFMailComposeViewController中遇到问题.

如果没有人登录邮件,我试图打开这个视图,应用程序崩溃如何解决这个问题?

如果我在ipad中登录frommail,之后我尝试加载它的工作正常.

谢谢,

Shyam Parmar

iphone xcode ipad xcode4 mfmailcomposeviewcontroller

5
推荐指数
1
解决办法
1838
查看次数

如何在iPhone sdk中的MFMailComposer中创建和附加CSV文件?

我已经创建了一个csv文件,我也将它附加到MFMailComposer,它显示我的邮件编写器,但当我发送给用户的电子邮件时,它没有显示我在电子邮件中附加csv文件.我已经使用此代码创建csv文件并在其中添加数据.

        NSMutableString *mainString=[[NSMutableString alloc]initWithString:@""];
        //NSMutableArray *section = [[NSMutableArray alloc] init];
        for(int i = 0;i<[NameArray count];i++)
        {
            NSString *string=[indexArray objectAtIndex:i];
            string=[string stringByReplacingOccurrencesOfString:@"\"" withString:@"\"\""];
            [mainString appendFormat:@"\"%@\"",string];


            string=[NameArray objectAtIndex:i];  
            string=[string stringByReplacingOccurrencesOfString:@"\"" withString:@"\"\""];
            [mainString appendFormat:@",\"%@\"",string];

            string=[typearray objectAtIndex:i];
            string=[string stringByReplacingOccurrencesOfString:@"\"" withString:@"\"\""];
            [mainString appendFormat:@",\"%@\"",string];

            [mainString appendFormat:@",\"%@\"",string];
            [mainString appendFormat:@"\n"];

        }

        NSLog(@"getdatafor csv:%@",mainString);

        NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,  NSUserDomainMask, YES);
        NSString *documentsDirectoryPath = [paths objectAtIndex:0];
        NSString *filePath = [documentsDirectoryPath  stringByAppendingPathComponent:@"history.csv"];
//        filePath = [filePath stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
        NSData* settingsData;
        settingsData = [mainString dataUsingEncoding: NSASCIIStringEncoding];

        NSError *error;
        [settingsData writeToFile:filePath atomically:YES];
//            NSLog(@"writeok"); …
Run Code Online (Sandbox Code Playgroud)

csv iphone mfmailcomposeviewcontroller

5
推荐指数
1
解决办法
1991
查看次数

如何防止MFMailComposeViewController的取消崩溃?

某处:

if([MFMailComposeViewController canSendMail])
{
    MFMailComposeViewController *email_vc = [[MFMailComposeViewController alloc] init];
    email_vc.mailComposeDelegate = self;

    [email_vc setSubject:subject];
    [email_vc setMessageBody:message isHTML:FALSE];
    [email_vc setToRecipients:recipients];

    [self presentModalViewController:email_vc animated:FALSE];
    [[UIApplication sharedApplication] setStatusBarHidden:TRUE];
    [email_vc release];
}
else
...
Run Code Online (Sandbox Code Playgroud)

别的地方:

- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error
{
    switch (result) 
    {
        case MFMailComposeResultCancelled:
            NSLog(@"Cancelled");
            break;

        case MFMailComposeResultSaved:
            NSLog(@"Saved");
            break;

        case MFMailComposeResultSent:
            NSLog(@"Sent");
            break;

        case MFMailComposeResultFailed:
            NSLog(@"Compose result failed");
            break;

        default:
            NSLog(@"Default: Cancelled");
            break;
    }

    // This ugly thing is required because dismissModalViewControllerAnimated causes a crash
    // if called right away when …
Run Code Online (Sandbox Code Playgroud)

iphone mfmailcomposeviewcontroller

5
推荐指数
1
解决办法
3794
查看次数

iOS:是否可以通过动画来学习MFMailComposeViewController?

我正在努力将图像附加到MFMailComposeViewController一切都很好的工作但我想知道这是可能给动画的附件?

对于Ex: - 当我们在iPhone设备中附加照片库中的图像时.并选择邮件按钮,所有选择的图像移动MailComposeViewcontroller与尼斯动画.

所以,任何伙伴都可以指导我这些东西是否有可能.如果是,那么我该如何设置动画附件.

iphone objective-c ios mfmailcomposeviewcontroller

5
推荐指数
1
解决办法
223
查看次数

UIAlertController不会显示 - 在Swift中

我创造了一个ContactUsViewController.

在此控制器中,用户将从a中选择一个选项pickerView,然后在a中键入消息,textView然后按"发送电子邮件"按钮.

当他们按下按钮时,它会创建一个,MFMailComposeViewController以便他们可以发送电子邮件.现在,当电子邮件发送,保存,取消或失败时,MFMailComposeViewController关闭它们在我的应用程序中.我想要一个警报然后似乎给他们一个更新,关于刚刚发生的事情.我最初使用UIAlertView设置了这个,并将此代码放在fun mailComposeController函数中,如下所示:

func mailComposeController(controller: MFMailComposeViewController, didFinishWithResult result: MFMailComposeResult, error: NSError?) {

    switch result.rawValue {

    case MFMailComposeResultCancelled.rawValue:
        NSLog("Email cancelled")
    case MFMailComposeResultSaved.rawValue:
        NSLog("Email saved")
        let sendMailErrorAlert = UIAlertView(title: "Email saved", message: "Your email has been saved in Mail.", delegate: self, cancelButtonTitle: "OK")
        sendMailErrorAlert.show()
    case MFMailComposeResultSent.rawValue:
        NSLog("Email sent")

        let alertController = UIAlertController(title: "test", message: "test", preferredStyle: .Alert)
        let okButton = UIAlertAction(title: "Okay", style: .Default, handler: nil)
        alertController.addAction(okButton)
        presentViewController(alertController, animated: …
Run Code Online (Sandbox Code Playgroud)

uialertview ios swift uialertcontroller mfmailcomposeviewcontroller

5
推荐指数
1
解决办法
7838
查看次数

仅限MFMailComposeViewController和iOS 10的隐私问题

使用Xcode 8.0重建已发布的应用程序,该应用程序使用PLCrashReporter,AWS Cognito/SNS和Google分析框架.

仅在iOS 10.x设备上看到,在运行我的测试存储桶期间不再显示邮件撰写vc.在Xcode控制台中,当到达if([MFMailComposeViewController.canSendMail])时,我会立即看到这些消息:

[MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
[MC] Filtering mail sheet accounts for bundle ID: [MY BUNDLE ID], source account management: 1
[MC] Result: YES
Run Code Online (Sandbox Code Playgroud)

我在这里找到了一种对这些控制台消息的引用:iOS 10上的UIActivityViewController崩溃

但我的应用程序不使用照片,我仍然尝试将链接中提到的照片隐私说明添加到我的info.plist中,但是当然没有快乐.问题依然存在.

我的应用程序确实使用相机,扫描条形码.相机隐私说明在info.plist中,自去年以来一直存在.该应用程序不使用其他需要隐私说明的功能.

连接iOS 9.3.5设备时,相同的准确代码和XC8设置按预期工作.

有人见过这个吗?

objective-c plcrashreporter ios10 xcode8 mfmailcomposeviewcontroller

5
推荐指数
1
解决办法
3808
查看次数

无法在Swift 3.0中关闭MFMailComposeViewController

MFMailComposeViewController不能按取消或发送按钮后,予以驳回。我已经添加MFMailComposeViewControllerDelegate了课程,但是仍然无法正常工作吗?

这是我的代码:

func sendEmail() {
    let MailVC = MFMailComposeViewController()
    MailVC.mailComposeDelegate = self
    MailVC.setToRecipients(["\(emailLabel?.text)"])
    MailVC.setSubject("Set your subject here!")
    MailVC.setMessageBody("Hello this is my message body!", isHTML: false)
    // Present the view controller modally.
    self.present(MailVC, animated: true, completion: nil)
}

func mailComposeController(controller: MFMailComposeViewController,
                           didFinishWithResult result: MFMailComposeResult, error: NSError?) {
    // Dismiss the mail compose view controller.
    controller.dismiss(animated: true, completion: nil)
}
Run Code Online (Sandbox Code Playgroud)

ios swift3 mfmailcomposeviewcontroller

5
推荐指数
1
解决办法
1260
查看次数

iOS 11 presentViewController落后于呈现控制器

我有一个奇怪的问题,我只是做一个简单的呈现模态视图控制器.MFMailComposeViewController确切地说.但是,它出现在呈现控制器后面,因此您无法发送任何电子邮件或类型.您可以UINavigationBar在邮件编辑器上看到"取消"按钮,但会弹出UIAlertController显示控制器的后面.这是怎么发生的?这是iOS 11问题吗?对于UIAlertControllers 我也有类似的行为.

此外,如果我按下发送并按下我的按钮以弹出另一个Composer,它将正常工作.这只是第一个.

请参阅我从Xcode获得的附图.

在此输入图像描述

MFMailComposeViewController *mailer = [[MFMailComposeViewController alloc] init];
mailer.mailComposeDelegate = self;
mailer.modalPresentationStyle = UIModalPresentationFormSheet;
[mailer setSubject:@"subject Feedback"];
[mailer setToRecipients:@[@"email address"]];
[mailer setMessageBody:@"" isHTML:NO];
[self presentViewController:mailer animated:YES completion:nil];
Run Code Online (Sandbox Code Playgroud)

编辑:添加控制器以获取更多信息.

#import "AboutViewController.h"
#import <MessageUI/MessageUI.h>


@interface AboutViewController () <MFMailComposeViewControllerDelegate>
@property (nonatomic, strong) IBOutlet UIView *contentView;
@end

@implementation AboutViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"About this app";
    _contentView.layer.cornerRadius = 10.;
    _contentView.layer.shadowColor = [UIColor blackColor].CGColor;
    _contentView.layer.shadowRadius = 3.;
    _contentView.layer.shadowOpacity = 0.4;
    _contentView.layer.shadowOffset …
Run Code Online (Sandbox Code Playgroud)

modalviewcontroller ios ios11 mfmailcomposeviewcontroller

5
推荐指数
1
解决办法
967
查看次数