iphone mailcomposer
i have my tabbar and i can hide this tab bar by the following code below but when tapping cancle of iphone mail composer does not return to the default screen can you please guide how can i do this
-(void)displayComposerSheet
{
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;
[picker setSubject:@""];
// Set up recipients
NSArray *toRecipients = [NSArray arrayWithObject:@""];
NSString *emailBody = @"";
[picker setMessageBody:emailBody isHTML:NO];
//[self presentModalViewController:picker animated:YES];
UIViewController *xyz=(UIViewController*)[myMarketsVicAppDelegate getMa开发者_高级运维inTabbarRef];
[xyz presentModalViewController:picker animated:YES];
[picker release];
}
- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error
{
[self dismissModalViewControllerAnimated:YES];
}
You must have to implement following Delegates.
- UINavigationControllerDelegate
- MFMailComposeViewControllerDelegate,
Like this
<MFMailComposeViewControllerDelegate,UINavigationControllerDelegate>
.
Above might be an issue, because - If you have not implemented above delegate, It will give you compile time warnings but however it will execute.
精彩评论