Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8294651
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T14:17:45+00:00 2026-06-08T14:17:45+00:00

I am getting a really weird error MFMailCompseViewController. The error is error: address doesn’t

  • 0

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.

This is specific to MFMailComposeViewController as I have tried to present a plain view controller modally and it dismisses fine.

Here is the code I wrote to calland present mail composer:

- (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<a href=\"http://www.agilerocket.com\">Sent via Cap That - Available in the Apple App Store</a>";

[mfViewController setMessageBody:contactMessage isHTML:YES];

[self presentViewController:mfViewController animated:YES completion:nil];

}

- (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];
}];

}

Thanks in advance for anyone’s help on this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T14:17:48+00:00Added an answer on June 8, 2026 at 2:17 pm

    I’m getting the same error in my app, acting on a tap gesture on a HUD. My gesture recognizer method is using a block property on the HUD to perform the needful actions, and there’s where it’s crashing (the code within the block never gets to run). Apparently the program cannot access that code, and since you also have a completion block that might be a clue to what’s happening.

    I don’t see that I’m doing anything wrong in my code, and you don’t seem to be doing that either, so maybe it’s a bug. Are you by any chance running a developer preview of Xcode (4.4 or 4.5)?

    Edit: it turns out my problem was that the code block property was being released before it got the chance to run. I think a similar thing might happend in your case, with the alert var. Can you try moving the alert init within the completion block?

    Edit 2: As an alternative, try prefixing the alert init with __weak (or __unsafe_unretained if you’re targetting iOS 4.3), that should do it. If you’re not using ARC, use __block instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing a Silverlight 3 app and getting this really weird error when I
I'm getting a really weird error where after I leave the for scope I
I keep getting this weird error message every time I'm testing my app on
i'm getting a really weird error. Somehow no matter what page I'm on it,
i m having a really weird error: i am using buffered reader (br) and
I'm getting this weird error on some stuff I've been using for quite a
Heads up: This is a weird question. I've got some really useful macros that
I'm running django on Dreamhost right now with fastcgi, and I'm getting really weird
So i have a really weird problem with a knockoutjs click binding not getting
I am having really weird problem: Fatal error: Allowed memory size of 134217728 bytes

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.