3
我使用MFMailComposeViewController在我的應用程序發送電子郵件。
當我運行我的應用程序儀器,
我發現電子郵件後發現泄漏。iPhone - 漏洞在MessageUI框架?
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];
}
發佈您的代碼。 – Dancreek