I found PDFView will cause memory leak, so I try another way to show PDF.
I use a scrollView that has a contentView for all the PDF page size.
For example, if one PDF page resolution is 480 x 320, then 5 pages PDF's contentView size is 2400 x 320. And I reuse 3 UIViews (as above image, preload and current pages) for showing PDF pages on contentView, every page size is 480 x 320. If now it shows 1st page, then preload 2nd page; if it shows 2nd page, then preload 1st page and 3rd page.
When scrollview moves to next page, I always load the current shown page and next/last page. So I have to remove page using removeFromSuperview(). Then I load the removed page as new one, and paste it into new position on contentView.
The problem is, removing the page from superview won't release the memory. So a many pages PDF will crash when memory is overload.
So how could I force release memory? I have read those old posts but not find the answer.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…