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

  • Home
  • SEARCH
  • 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 3990724
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T06:31:46+00:00 2026-05-20T06:31:46+00:00

I found some great example code some months ago to add a compose button

  • 0

I found some great example code some months ago to add a compose button to a view to allows emails to be sent within an app…

http://blog.mugunthkumar.com/coding/iphone-tutorial-in-app-email/

However, I want to be able to show the email, have it handled for use with any of my views.
I have a standard class / method to show the actionsheet, so I can use it in all my views.

This is the code from another button in my class.

-(UIViewController *)showHelpClickButtonAtIndex:(int)buttonIndex:(UIView *)
      vw:(UIViewController *)vc:(BOOL)useNav:(HelpPage)page{

if (buttonIndex == CommonUIInfoHelpPagesBtnIdx) {
vc = [[HelpViewController alloc] initWithNibName:@"HelpView" 
         bundle:nil onPage:page];
   [vw addSubview:vc.view];
   return [vc autorelease]; 

Heres the example code, without any of my many attempts to make it work..

MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;
[picker setSubject:titleText.text];
NSString *emailBody = @"Whatever";
[picker setMessageBody:emailBody isHTML:YES]; 
picker.navigationBar.barStyle = UIBarStyleBlack; 
[self presentModalViewController:picker animated:YES];
[picker release];

Its mainly the MFMailComposeViewController and replace presentModalViewController with addSubview where I’m having problems.

Can anyone point me in the right direction ?

  • 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-05-20T06:31:47+00:00Added an answer on May 20, 2026 at 6:31 am

    According to the docs for MFMailComposeViewController:

    To display the view managed by this
    view controller, you can use any of
    the standard techniques for displaying
    view controllers. However, the most common
    way to present this interface is do so modally
    using the presentModalViewController:animated: method

    The first sentence is telling us that you should be showing the view controller for the mail composer in one of the regular ways; adding the view controller’s view as a subview to an existing UIView, if that’s what you’re trying to do, isn’t one of the standard ways Apple want you to use, and so might not work or be unpredictable.

    Related to this is Apple’s advice that a UIViewController should be responsible for showing a whole part of your UI, not just part of it — which your approach also seems to go against.

    So, the solution is to present the mail composer like a normal view controller would be: modally, or pushed onto a nav stack, or presented as the top view under UIWindow, etc.

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

Sidebar

Related Questions

Found some old code, circa VS 2003. Now I have just VS 2008 (SP1)
I found some code in a project which looks like that : int main(int
I have found some in the Cappuccino website (vim, textmate and SubEthaEdit), but not
I have found some libraries or web services in PHP that does the job.
I have found some info on the subject ( like this link) , but
After googling a bit I have found some tips about how to get online
Quick question regarding CSS and the browser. I tried searching SO and found some
I've been parsing through some log files and I've found that some of the
I'm currently working on project with Haskell, and have found myself some trouble. I'm
I've found that on some occasions I can edit the source while debugging. Are

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.