Note that there are some explanatory texts on larger screens.

plurals
  1. POStrange error when dismissing MFMailComposeViewController: error: address doesn't contain a section that points to a section in a object file
    primarykey
    data
    text
    <p>I am getting a really weird error MFMailCompseViewController. The error is "error: address doesn't contain a section that points to a section in a object file". The app crashes after MFMailCompseViewController dismisses and the email actually get sent.</p> <p>This is specific to MFMailComposeViewController as I have tried to present a plain view controller modally and it dismisses fine.</p> <p>Here is the code I wrote to calland present mail composer:</p> <pre><code>- (void) emailImage:(UIImage *)img { //verified that the image is being returned correctly UIImage *img1 = [[_delegate photoBrowser:self photoAtIndex:0] underlyingImage]; MFMailComposeViewController *mfViewController = [[MFMailComposeViewController alloc] init]; mfViewController.mailComposeDelegate = self; NSString *subject = @"Check out this photo I took - Cap That App"; [mfViewController setSubject:subject]; NSData *imgData = UIImageJPEGRepresentation(img1, 1.0); [mfViewController addAttachmentData:imgData mimeType:@"image/jpg" fileName:@"photo.jpg"]; NSString *contactMessage = @"\n\n&lt;a href=\"http://www.agilerocket.com\"&gt;Sent via Cap That - Available in the Apple App Store&lt;/a&gt;"; [mfViewController setMessageBody:contactMessage isHTML:YES]; [self presentViewController:mfViewController animated:YES completion:nil]; </code></pre> <p>}</p> <pre><code>- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error { UIAlertView *alert = [[[UIAlertView alloc] initWithTitle:@"Status:" message:@"" delegate:nil cancelButtonTitle:@"ok" otherButtonTitles:nil] autorelease]; switch (result) { case MFMailComposeResultCancelled: alert.message = @"You chose not to send the email."; break; case MFMailComposeResultSaved: alert.message = @"Your email was saved as a draft. It has not been sent yet."; break; case MFMailComposeResultSent: alert.message = @"Your email has been sent!"; break; case MFMailComposeResultFailed: alert.message = @"There was an error sending the email. Please verify your email is working and try again."; break; default: alert.message = @"You chose not to send the email."; break; } [self dismissViewControllerAnimated:YES completion:^(void) { [alert show]; }]; </code></pre> <p>}</p> <p>Thanks in advance for anyone's help on this.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload