1

I am sending video file as an mail attachment, when i send small video then every thing is work perfect and mail has sent, but when video size is large the it give memory warning several time and unable to sent the mail. I am allocating memory for NSdata and releasing it properly. Please give your valuable suggestion. Thanks in advance Here is my code

    MFMailComposeViewController *picker1 = [[MFMailComposeViewController alloc] init];
                    picker1.mailComposeDelegate = self;
                    [picker1 setSubject:@"AKR Video"];
                    NSData *videoData=[[NSData alloc] initWithContentsOfFile:self.path ];

                    [picker1 addAttachmentData:videoData mimeType:@"video/MOV" fileName:@"Video.MOV"];
                    [videoData release];
                    [self presentModalViewController:picker1 animated:YES];
                    [picker1 release];
alok srivastava
  • 761
  • 8
  • 19

1 Answers1

0

Loading a 15 MB anything into RAM on a pre-2009 iPhone or iPod is going to really push the limits of your process's available memory, so it's not surprising there's a cap. I wouldn't try to convince the compose view to accept a larger attachment; instead, I'd suggest you transfer the file to some external server and either e-mail a link to it or send the mail from there.(+1)

Raju
  • 759
  • 3
  • 18