iOS 10 Quicklook内存使用
问题描述:
当生病将一些图像加载到我的QuicklookController时,所使用的内存永远不会被内存管理器释放。例如:iOS 10 Quicklook内存使用
override func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) {
let photoFile = photos[indexPath.row] as Photo
currentFilePath = photoFile.filePath
let preview = QLPreviewController()
preview.dataSource = self
self.navigationController?.pushViewController(preview, animated: false)
}
func documentsDirectoryURL() -> NSURL {
let manager = NSFileManager.defaultManager()
let URLs = manager.URLsForDirectory(.DocumentDirectory, inDomains: .UserDomainMask)
return URLs[0]
}
func previewController(controller: QLPreviewController, previewItemAtIndex index: Int) -> QLPreviewItem {
return documentsDirectoryURL().URLByAppendingPathComponent(currentFilePath)
}
这里生病的图像。图像大小约为200kbytes,大小约为2500x1250像素。内存增加了大约10 MB,但是当关闭控制器(后退按钮)时仍然使用内存。因此,每次点击都需要10 MB的额外内存(如果图像相同,或者新的内存有Doesent问题)
如何强制QLPreviewController
释放使用的内存?
编辑:看来,这已经报道:
https://github.com/jcamiel/radars/blob/6b02382c08cdd9312df325a7a08ea9efeec5727b/28318213/radar.md
https://forums.developer.apple.com/thread/63020
EDIT2:
与2现在的iPad Pro的测试9.7
首先,iOS版10.0.1 - >如上所述增加内存。 其次,的iOS 9.3.5 - >无内存问题
如此看来它真的只有iOS的10错误...
答
似乎是固定的与iOS 10.0.2