1

我正在为 iPad 应用程序中的邮件编写器表使用以下代码。我对 iPhone 使用了相同的代码。有效。
我正在使用 cocos2d 在 iPad 上编写游戏。游戏处于风景模式。EmailScene 中的控件在 [picker presentModalViewController:picker animated:YES] 处停止;它没有给出任何错误。我应该更改 iPad 的代码吗?

@interface EmailScene : CCScene <MFMailComposeViewControllerDelegate>
{
    MFMailComposeViewController *picker;
}

-(void)displayComposerSheet;

@end

@implementation EmailScene

- (id) init {
    self = [super init];
   if (self != nil) {
        [self displayComposerSheet];
   }
   return self;
}

// Displays an email composition interface inside the application. Populates all the Mail fields.
-(void)displayComposerSheet
{

    [[CCDirector sharedDirector] pause];

    picker = [[MFMailComposeViewController alloc] init];
    picker.mailComposeDelegate = self;

    //Fill in the email as you see fit
    NSArray *toRecipients = [NSArray arrayWithObject:@"srikanth.rongali786@gmail.com"]; 
    [picker setToRecipients:toRecipients];

    //display the view
    [[[CCDirector sharedDirector] openGLView] addSubview:picker.view];
    [[CCDirector sharedDirector] stopAnimation];  

//When I commented the following two lines the mail page is opening.
    //[picker presentModalViewController:picker animated:YES];

    //[picker release];

}  

但是,问题是我的游戏是横向模式,而邮件表是以纵向模式显示的。谢谢你。

4

1 回答 1

0
于 2010-07-05T14:00:06.273 回答