【问题标题】:iPhone - Leaks in MessageUI framework?iPhone - MessageUI 框架中的泄漏?
【发布时间】:2012-05-01 21:34:59
【问题描述】:

我使用 MFMailComposeViewController 在我的应用程序中发送电子邮件。
当我使用 Instruments 运行我的应用程序时,
在我点击发送电子邮件后,我看到了泄漏。

Leaked Object   #   Address Size    Responsible Library Responsible Frame

MutableMessageHeaders,1 0x6be950    32 Bytes    MessageUI   +[MFComposeTypeFactory headersFromDelegate:]

_MFOutgoingMessageBody,1    0x1190ed0   32 Bytes    Message -[MessageWriter createMessageWithPlainTextDocumentsAndAttachments:headers:]

你知道怎么解决吗,
这是 MessageUI 框架中的泄漏吗?

- (void)showMailComposer
{
        MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
        picker.mailComposeDelegate = self;
        [picker setSubject:@"Subject"];
        NSString *emailBody = @"Email body";
        [picker setMessageBody:emailBody isHTML:NO];
        [self presentModalViewController:picker animated:YES];
        [picker release];
}

#pragma mark -
#pragma mark Dismiss Mail/SMS view controller

    // Dismisses the email composition interface when users tap Cancel or Send. Proceeds to update the 
    // message field with the result of the operation.
    - (void)mailComposeController:(MFMailComposeViewController*)controller 
              didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error 
{
            [self dismissModalViewControllerAnimated:YES];
    }

【问题讨论】:

    标签: iphone email messageui


    【解决方案1】:

    是的,看起来像。但是每封发送的电子邮件总共有 64 个字节,这不是您应该担心的。

    【讨论】:

    • 讨厌成为一个snoot。但是,这似乎是一种流行的观点......而且我看到内存泄漏率随着每次操作系统更新而增加。这一切真正意味着用户必须更频繁地重启手机。与此同时,Apple 告诉我们要尽一切努力让用户体验更好......嗯。
    猜你喜欢
    • 2010-11-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-05-29
    • 2011-03-04
    • 2016-06-16
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多