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 8903867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T01:58:40+00:00 2026-06-15T01:58:40+00:00

My implementation is pretty simple: In the .h file, I’m implementing MFMailComposeViewControllerDelegate And in

  • 0

My implementation is pretty simple:

In the .h file, I’m implementing MFMailComposeViewControllerDelegate

And in the .m file, I have the following bit of code:

-(void)MailCurrentViewAsAttachment
{   
    if ( [MFMailComposeViewController canSendMail] ) {
        MFMailComposeViewController * mailComposer = [[MFMailComposeViewController alloc] init];
        mailComposer.delegate = self;
        [mailComposer addAttachmentData:imageData mimeType:@"image/jpeg" fileName:@"attachment.jpg"];

        [self presentViewController:mailComposer animated:YES completion:nil];
    }
}

-(void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error
{
    [self dismissViewControllerAnimated:YES completion:nil];
}

The variable imageData above is of the UIImage type, and I know for sure there’s nothing wrong with it: the required image shows up properly in the compose mail window.

However clicking the Cancel button does not dismiss the Compose window. What am I missing?

Note: I’m using iOS 6 with the latest version of xcode, and my app is a Universal app.

  • 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-15T01:58:41+00:00Added an answer on June 15, 2026 at 1:58 am

    You are setting the wrong delegate. You want:

    mailComposer.mailComposeDelegate = self;
    

    MFMailComposeViewController extends UINavigationController. So setting delegate is for the UINavigationControllerDelegate.

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

Sidebar

Related Questions

I seem to have a problem with my very simple implementation of a file
This code is pretty simple, is it correct? I don't know if I should
I have a pretty simple general programming problem, yet I can't quite get the
I have to develop a pretty simple php website so I don't need framework.
I have pretty simple JAX-RS WS: @Stateless @Path(/foo) public class FooFacadeBean { @GET @Produces(MediaType.TEXT_HTML)
I have a pretty simple button that is marked up like this: <a href=#
I have a pretty simple set up for a messaging application. I simply get
I've been pretty puzzled by this one. It seems as though my implementation of
Is there a JavaScript implementation of the OpenVG standard based on WebGL? I'm pretty
Can someone post a quick example (implementation) of the stateMachine? The concept is pretty

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.