我正在尝试从我的 iphone 应用程序发送附加到邮件的 sqlite 数据库,我收到了电子邮件,但没有收到数据库文件,对不起我的语法,我来自西班牙,这是我的代码。
-(IBAction)mandar:(id)sender
{
MFMailComposeViewController *composer=[[MFMailComposeViewController alloc]init];
[composer setMailComposeDelegate:self];
if ([MFMailComposeViewController canSendMail])
{
[composer setToRecipients:[NSArray arrayWithObjects:@"Introducir direccion",nil]];
[composer setSubject:@"Base de datos"];
[composer setMessageBody:@"Mensage" isHTML:YES];
[composer setModalTransitionStyle:UIModalTransitionStyleCrossDissolve];
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *file = [documentsDirectory stringByAppendingPathComponent:@"capturas.sqlite"];
NSData *data=[NSData dataWithContentsOfFile:file];
[composer addAttachmentData:data mimeType:@"application/sqlite" fileName:@"capturas.sqlite"];
[self presentModalViewController:composer animated:YES];
}
else {
UIAlertView *alert=[[UIAlertView alloc] initWithTitle:@"Error" message:@"No se a podido mandar el mensage" delegate:self cancelButtonTitle:@"dismis" otherButtonTitles:nil, nil];
[alert show];
}
}