通过MFMailcomposeController发送时,在sqlite中发现空数据 [英] Found empty data in sqlite when send via MFMailcomposeController

查看:99
本文介绍了通过MFMailcomposeController发送时,在sqlite中发现空数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过电子邮件发送 SQLite(Coredata sqlite文件)文件,但在收到的邮件的所有表中都发现空数据.

I am sending SQLite(Coredata sqlite file) file via email but found empty data in all tables in the received mail.

我正在使用以下代码:

MFMailComposeViewController *mc = [[MFMailComposeViewController alloc] init];
mc.mailComposeDelegate = self;
[mc setSubject:subject];
[mc setMessageBody:body isHTML:FALSE];
if (attachmentData) {
 [mc addAttachmentData:attachmentData mimeType:fileMimeType fileName:fileName];
}
if (!recipients || recipients.count == 0) {
 recipients = @[];
}
[mc setToRecipients:recipients];
[presentedViewController presentViewController:mc animated:YES completion:nil];

在这里,fileMimeType ="application/x-sqlite3"和fileName:xyz.sqlite

Here, fileMimeType = "application/x-sqlite3" and fileName: xyz.sqlite

在此处找到相同的问题,但没有解决方案.知道怎么做吗?

Found the same question here, but with no solution. Any idea how to do that?

推荐答案

正如我在评论中指出的那样,iOS默认使用SQLite的WAL模式,因此您需要将WAL文件作为附件包含.

As I indicated in comments, iOS uses SQLite’s WAL mode by default, so you need to include the WAL file as an attachment.

这篇关于通过MFMailcomposeController发送时,在sqlite中发现空数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆