How to manage memory within a QLPreviewController

大城市里の小女人 提交于 2019-12-24 13:58:43

问题


We are currently using a QLPreviewController to load a collection of PDFs. The size of the collection can range from 16, 95, or even 1600+ PDFs. Due to the data source of the PreviewController containing multiple items we now have the ability to swipe left or right within the preview modal and load the next PDF in the list.

This functionality has introduced an issue where a gray screen appears within the controller at various locations within the collection. It may occur on the 3rd item, 50th, or 161st item; this error is very inconsistent and difficult to reproduce.

When the gray screen appears in the modal the ability to swipe left or right is no longer available. After dismissing the modal and re-selecting the PDF from the table source, it loads without issue. This experience reinforces our theory that this gray screen appears due to memory management issues.

What is the proper way to manage memory within a QLPreviewController regardless of size of the data source? Are there code examples which demonstrate how to use a QLPreviewController with multiple items in its data source?

来源:https://stackoverflow.com/questions/27850198/how-to-manage-memory-within-a-qlpreviewcontroller

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