VFR-Reader Crashing in iOS8

筅森魡賤 提交于 2020-01-01 06:27:17

问题


I tested an app that is currently working with the VFR-Reader-Core on iOS8 and I get a complete crash when I try to open a PDF from it. Am I the only one with this problem? any idea of where I can search to correct this? Here is the crash report

Thank you


回答1:


In iOS 8, Te file system layout of app containers has changed. Applications and their content are no longer stored in one root directory.

From the iOS 8 Release Notes:

The file system layout of app containers has changed on disk. Rather than relying on hard-coded directory structure, use the NSSearchPathForDirectoriesInDomains function or the URLForDirectory:inDomain:appropriateForURL:create:error: method of the NSFileManager class. See Accessing Files and Directories in File System Programming Guide.

I've had a brief look into the issue and i can see that VFRReader does not follow the above recommendations from Apple.

I was going to rase an issue on the Github page however issue tracking seems to have been disabled. If i get some extra time today, I will look into resolving this and raising a pull request.

Edit: Check out my fork for a version that works on iOS8: https://github.com/liamnichols/Reader
I've also submitted a pull request on the original repo: https://github.com/vfr/Reader/pull/54




回答2:


From the ReaderDocument.m of vfreader, the author stated that

"As well, // since as of iOS 8, the application's ~/Documents directory no longer lives in // its bundle, any bundled PDF files must be copied into the the application's // ~/Documents directory before they can be accessed."

Hope it helps.




回答3:


Finally stumped on this:

@synchronized(nil)  {
    CGContextDrawPDFPage(context, _PDFPageRef);
}

and it's works now in iOS8.

EDIT: did some changes in the code and now even this does not help me avoid this crash. But now if I run on device then it works. (crash on simulator).

Memory leaks, sometimes the good way, sometimes the wrong way :D



来源:https://stackoverflow.com/questions/25372149/vfr-reader-crashing-in-ios8

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