Hi,
I'm having problems displaying a modal view for sending emails (MFMailComposeViewController). I'm trying to display this modal view from a detailed view that was pushed on the stack by selecting a cell in an initial table view. I think I probably have some mess with the navigation stacks,as I do not fully understand it. My problem is that although the MFMailComposeViewController does display, I do not get the Send and Cancel buttons that I usually go with the MFMailComposeViewController view. I just get the 'Back' button of my detail view in my navigation bar.
My detail view is a subclass of UIViewController conforming to MFMailComposeViewControllerDelegate and UINavigationControllerDelegate protocols:
And my methods for sending emails is:
-(void)sendEmail {
MFMailComposeViewController *mailComposer = [[MFMailComposeViewController alloc] init];
mailComposer.mailComposeDelegate = self;
if ([MFMailComposeViewController canSendMail]) {
[mailComposer setToRecipients:[NSArray arrayWithObjects:@"test@gmail.com",nil]];
[mailComposer setSubject:@"Subjecy"];
[mailComposer setMessageBody:@"Body" isHTML:NO];
[self presentModalViewController:mailComposer animated:YES];
}
[mailComposer release];
}
- (void)mailComposeController

MFMailComposeViewCont roller*)controller didFinishWithResult

MFMailComposeResult)result error

NSError*)error
{
[self dismissModalViewControllerAnimated:YES];
if (result == MFMailComposeResultFailed) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Message Failed" message:@"Your message failed to send" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
[alert release];
}
}
Many thanks for any help.