退出Mail Composer后应用程序崩溃

时间:2010-08-02 07:49:02

标签: email uiwebview crash mfmailcomposeviewcontroller

我的应用程序在关闭MFMailComposeViewController后不久就崩溃了。 UIWebDocumentView正在释放,它释放一个ComposeBodyField对象,并在objc_msgSend上崩溃。它只在某些时候发生,并且仅在旧设备上发生。我假设某些内容正在被释放/清理之前,所以当发送消息时,该对象不存在。

问题在于我无法获得更多信息,而且我不知道它们是如何联系在一起的。如果有人能够对此有所启发,那就太棒了。

2 个答案:

答案 0 :(得分:0)

在消除MFMailComposer后,我遇到了类似的崩溃问题。删除[myMailComposer发布]后一切都很好。我确定我遵循内存管理的规则,因为它在应用程序中都很好,除非在这个特定的地方。现在我的“Build& Analyze”唠叨了,但应用程序非常稳定。

答案 1 :(得分:0)

请尝试使用适合我的代码。

 - (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error

{
switch (result)
{
    case MFMailComposeResultCancelled:
    {
        break;
    }
    case MFMailComposeResultSaved:
    {
        break;
    }
    case MFMailComposeResultSent:
    {


        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Email" message:@"Email Sent" delegate:self cancelButtonTitle:@"OK" otherButtonTitles: nil];
        [alert show];
        [self performSegueWithIdentifier:@"backHome" sender: self]; 

        break;
    }
    case MFMailComposeResultFailed:
    {
       NSLog(@" Failed");
        break;
    }
    default:
    {
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Email" message:@"Email Failed" delegate:self cancelButtonTitle:@"OK" otherButtonTitles: nil];
        [alert show];


    }
        break;
}
}
相关问题