Strange leak when using QuickLook framework in iOS4.0

点点圈 提交于 2020-01-17 07:24:09

问题


I have used QuickLook framework for opening one 2 page pdf file modally, and everything works. However, after testing (Instruments Leaks) the project with different iOS versions and devices, I have noticed strange leak that was appearing when running Intruments leaks on iPhone 3GS + iOS 4.0 device. The leak was appearing after opening previewer modally on the parent view and closing previewer. Strange, but no leak was appearing when testing on simulator and iPhone 4 + iOS 5.0. I'm using Xcode 4.2.

The code is pretty straightforward. Here's a button action that opens previewer modally:

-(IBAction)openFiles:(id)sender{

QLPreviewController *preview = [[QLPreviewController alloc] init];

preview.dataSource = self;
preview.currentPreviewItemIndex = 0; //for previewing only one pdf file

[self presentModalViewController:preview animated:YES];

[preview release];

}

Here are the details for a leak in Instruments:

来源:https://stackoverflow.com/questions/7992308/strange-leak-when-using-quicklook-framework-in-ios4-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!