开发者

iphone mailcomposer

开发者 https://www.devze.com 2022-12-28 20:54 出处:网络
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

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.

  1. UINavigationControllerDelegate
  2. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号