Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/102.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
MFMailComposeViewController&x27;s代表未处理';取消';按钮或iOS 4.x及更早版本_Ios_Delegates_Mfmailcomposeviewcontroller - Fatal编程技术网

MFMailComposeViewController&x27;s代表未处理';取消';按钮或iOS 4.x及更早版本

MFMailComposeViewController&x27;s代表未处理';取消';按钮或iOS 4.x及更早版本,ios,delegates,mfmailcomposeviewcontroller,Ios,Delegates,Mfmailcomposeviewcontroller,根据苹果提供的代码示例,我已经在我的应用程序中实现了标准邮件功能。 我的代码如下 - (IBAction)mailBtnPressed:(id)sender { if ([MFMailComposeViewController canSendMail]) { mailer = [[MFMailComposeViewController alloc] init]; [mailer setDelegate:self]; [mailer setSubject:@"Een b

根据苹果提供的代码示例,我已经在我的应用程序中实现了标准邮件功能。 我的代码如下

- (IBAction)mailBtnPressed:(id)sender
{
if ([MFMailComposeViewController canSendMail])
{
    mailer = [[MFMailComposeViewController alloc] init];

    [mailer setDelegate:self];

    [mailer setSubject:@"Een berichtje via de iPhone app"];         mailer.mailComposeDelegate = self;
    NSArray *toRecipients = [NSArray arrayWithObjects:@"studio@vrtfm.be", nil];
    [mailer setToRecipients:toRecipients];

    NSString *emailBody = @"";
    [mailer setMessageBody:emailBody isHTML:NO];

    [self presentModalViewController:mailer animated:YES];
}
else
{
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Oeps..."
                                                    message:@"Dit toestel ondersteunt geen mail functionaliteit."
                                                   delegate:nil
                                          cancelButtonTitle:@"OK"
                                          otherButtonTitles:nil];
    [alert show];
}
}

点击Send按钮调用委托,一切正常。但是,点击“取消”按钮不会调用代理,只会使视图变暗;应用程序就挂在那里

注意事项: 我没有在我的应用程序中显示状态栏

我使用的不是xib,而是代码
[[UIWindow alloc]initWithFrame:[[UIScreen mainScreen]bounds]

此邮件功能在iOS5、iOS5.1中运行良好。但只在较低版本中面对这个问题

我也尝试过使用
[mailer setMailComposeDelegate:self]

我现在的xib班有280480人

我在一个包含内容大小(1540960)的滚动视图中使用多个视图

使用方法[scrollView scrollRectToVisible:frame animated:YES]显示视图

请尝试查看此处

简短答复:

尝试更改代码行

[mailer setDelegate:self];

试试看这个

简短答复:

尝试更改代码行

[mailer setDelegate:self];


但这对我不起作用。尽管如此,我仍然面临着同样的问题,因为以下版本的IOS5我也面临着同样的问题毗湿奴。你找到答案了吗?@Vishnuvardhandevinei试着看看example@JohnGoodstadt试着看一个例子,但它对我不起作用。尽管如此,我仍然面临着同样的问题,因为以下版本的IOS5我也面临着同样的问题毗湿奴。你找到答案了吗?@Vishnuvardhandevinei试着看看example@JohnGoodstadt试着看一个例子
mailer.mailComposeDelegate = self;