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 ?