views:

2

answers:

0

Hi,

I have a View Based application and I have added a UITableView in the view with navigation bar and tab bar. But now when I try to add the MFMailViewController on the same view when there is no table or tab bar it does not work at all. I am using the following the code to add MFMailViewController

    MFMailComposeViewController *mailControl = [[MFMailComposeViewController alloc] init];
mailControl.mailComposeDelegate = self;

NSMutableArray *toTemp = [[NSMutableArray alloc] init];
[toTemp addObject:@"[email protected]"];

NSArray *to = toTemp;
[mailControl setToRecipients:to];
[mailControl setSubject:@"XXX"];

[toTemp release];   
NSLog(@"Sending mail");

[self presentModalViewController:mailControl animated:YES];
[mailControl release];

It prints Sending Mail so I am assuming that the MFMailViewController was initialized properly and it is not able to present it to the ModalViewController.

Any help on this is appreciated.

Regards, Ankur