0

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

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

4

2 回答 2

0

在关闭 MFMailComposer 后,我遇到了类似的崩溃问题。删除 [myMailComposer 版本] 后一切正常。我确信我遵守了内存管理的规则,因为除了这个特定的地方之外,它在应用程序中的所有地方都很好。现在我的“构建和分析”对它唠叨不休,但该应用程序非常稳定。

于 2010-11-02T13:57:28.093 回答
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;
}
}
于 2013-06-04T11:49:09.933 回答