iphone mailcomposer

时间:2010-05-04 06:39:56

标签: iphone

我有我的tabbar,我可以通过下面的代码隐藏此标签栏但是当点击iphone邮件编辑器的cancle没有返回到默认屏幕时,请指导我该怎么做

-(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 getMainTabbarRef];
    [xyz presentModalViewController:picker animated:YES];

    [picker release];
}


- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error
{
    [self dismissModalViewControllerAnimated:YES];
}

1 个答案:

答案 0 :(得分:0)

您必须实施以下代理。

  1. UINavigationControllerDelegate
  2. MFMailComposeViewControllerDelegate,
  3. 喜欢这个

    <MFMailComposeViewControllerDelegate,UINavigationControllerDelegate>

    上面可能是一个问题,因为 - 如果你还没有实现上面的委托,它会给你编译时警告但是它会执行。