相关疑难解决方法(0)

MFmailcomposer有时会出错?

我正在使用MFMailcomposer从我的iPhone应用程序发送邮件.它工作正常,但是当我将它移植到iPhone 5和ios6时

_serviceViewControllerReady:error: Error Domain=_UIViewServiceInterfaceErrorDomain Code=1 "The operation couldn’t be completed. (_UIViewServiceInterfaceErrorDomain error 1. 但如果我再次运行没有问题,它工作正常.

我正在呈现像这样的邮件作曲家

action
{
Class mailClass = (NSClassFromString(@"MFMailComposeViewController"));
    if (mailClass != nil)
    {
        // We must always check whether the current device is configured for sending emails
        if ([mailClass canSendMail])
        {
            [self displayComposerSheet];
        }
        else
        {
            [self launchMailAppOnDevice];
        }
    }
    else
    {
        [self launchMailAppOnDevice];
    }

}


void)displayComposerSheet 
{

    AppDelegate *appdelegate=[[UIApplication sharedApplication] delegate];
    MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
    picker.mailComposeDelegate = self;  

    [picker setSubject:@"report"];



    // Set up …
Run Code Online (Sandbox Code Playgroud)

iphone ipad ios

9
推荐指数
2
解决办法
5248
查看次数

如何在Swift中启动iOS邮件应用程序?

我正在创建一个带有密码重置功能的iOS应用程序,该功能可以向用户发送电子邮件.发送电子邮件后,我想向UIAlertController用户询问是否要打开邮件应用程序.

我在这里看到了各种各样的帖子:

let url = NSURL(string: "mailto:")
UIApplication.sharedApplication().openURL(url!)
Run Code Online (Sandbox Code Playgroud)

这可行,但不幸的是它启动了一条不是我想要的新消息.我只想启动应用程序,以便用户可以看到他们的收件箱.

uiapplication ios swift

9
推荐指数
1
解决办法
6356
查看次数

以编程方式通过电子邮件发送iphone附件

我正在编写一个iPhone应用程序,要求我以编程方式发送电子邮件附件.附件是一个csv文件,我通过代码创建.然后我将文件附加到电子邮件中,附件显示在手机上.但是,当我向自己发送电子邮件时,附件不会出现在电子邮件中.这是我正在使用的代码.

    [self exportData];

if ([MFMailComposeViewController canSendMail])
{
    NSString *filePath = [[NSBundle mainBundle] pathForResource:@"expenses" ofType:@"csv"];  
    NSData *myData = [NSData dataWithContentsOfFile:filePath]; 

    MFMailComposeViewController *mailer = [[MFMailComposeViewController alloc] init];

    mailer.mailComposeDelegate = self;

    [mailer setSubject:@"Vehicle Expenses from myConsultant"];

    NSString *emailBody = @"";
    [mailer setMessageBody:emailBody isHTML:NO];

    [mailer addAttachmentData:myData mimeType:@"text/plain" fileName:@"expenses"];

    [self presentModalViewController:mailer animated:YES];

    [mailer release]; 
}
else
{
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Failure"
                                                    message:@"Your device doesn't support the composer sheet"
                                                   delegate:nil
                                          cancelButtonTitle:@"OK"
                                          otherButtonTitles:nil];
    [alert show];
    [alert release];
}
}
- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error
{
    switch …
Run Code Online (Sandbox Code Playgroud)

email iphone

7
推荐指数
2
解决办法
1万
查看次数

iOS Swift:在收件箱电子邮件中打开邮件应用程序

晚上,我正试图通过按钮操作打开Mail应用程序的收件箱邮件...

在网络上,我看到有可能打开EmailComposer对象的电子邮件应用程序..但我不是要发新电子邮件,我只是想让用户检查电子邮件.

有小费吗?

email button ios swift

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

从我自己的应用程序启动邮件应用程序(iOS)

关于这个主题有很多问题,但没有更新的答案.我想在没有撰写视图的情况下打开本机iOS邮件应用程序(在我自己的应用程序中).所有答案都是如此,说这是不可能的,但应用程序Slack设法做到这一点.任何人都有任何想法?

apple-mail ios

2
推荐指数
1
解决办法
4211
查看次数

iphone:如何在iPhone Ebook App中添加电子邮件功能

我正在开发iPhone电子书应用程序.

在我的应用中,书籍是使用HTML创建的.在Index.html页面中,我必须发送电子邮件(发送)特定章节内容的电子邮件功能.

现在通过使用webview我显示index.html,并且我创建了UIActionSheet,它将显示Email按钮.

请建议我如何识别不同链接的索引以发送特定章节的电子邮件.

iphone xcode uiwebview

0
推荐指数
1
解决办法
3014
查看次数

标签 统计

ios ×4

iphone ×3

email ×2

swift ×2

apple-mail ×1

button ×1

ipad ×1

uiapplication ×1

uiwebview ×1

xcode ×1