I have an application in which I attach a zip file to a mail composer. I am using the code below to attach a zip file.
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *writableDBPath= [documentsDirectory stringByAppendingPathComponent:@"Records.zip"]; NSData *data = [NSData dataWithContentsOfFile: writableDBPath]; [picker addAttachmentData:data mimeType:@"application/zip" fileName:@"/Records.zip"];
File in the document directory: /var/mobile/Applications/46348DAA-9B4B-4DA8-98E0-3CEF880D2721/Documents/Records.zip
I am stuck in NSData *data = [NSData dataWithContentsOfFile:WritableDBPath]; I do not know what's the problem.
When I can install zip, I get a warning about getting memory *** - [_ UIRemoteViewControllerConnectionRequest save]: message was sent to the freed instance 0x1cd04690.
Please help me.
source share