在iOS 12.2中,将 true 传递给 PDFView 的 usePageViewController(_,withViewOptions:)将导致崩溃,但以下情况除外:
In iOS 12.2, passing true to PDFView's usePageViewController(_, withViewOptions:) will cause a crash with the following exception:
***由于未捕获的异常"CALayerInvalidGeometry"而终止应用程序,原因:"CALayer位置包含NaN:[nan nan]"
*** Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [nan nan]'
相同的代码在iOS 12.1上可以正常工作.我也有其他项目可以做到这一点,而这些项目 do 可以在iOS 12.2上运行,但是它们的视图控制器层次结构要复杂得多.
The same code works fine on iOS 12.1. I also have other projects that do this and those projects do work on iOS 12.2, but their view controller hierarchy is quite a bit more complicated.
是否可能缺少某些东西,还是应该向Apple提交错误报告?
Is there possibly something I'm missing, or should I file a bug report with Apple?
我在github上创建了一个小项目,该项目在 上演示了崩溃github/rudedogdhc/crash-pdfview-ios12.2
I have created a tiny project on github which demonstrates the crash at github/rudedogdhc/crash-pdfview-ios12.2
推荐答案尝试将 usePageViewController(_,withViewOptions:)(以及与此相关的其他所有设置)移到 viewDidAppear 而不是 viewDidLoad
Try moving usePageViewController(_, withViewOptions:) (and everything else you're setting up with it for that matter) into viewDidAppear instead of viewDidLoad
我遇到了同样的问题,并在这里找到了答案:在更新到Xcode 10.2之后,PDFKit出现了问题.有什么办法解决吗?
I ran into the same problem and found the answer here: There's problem with PDFKit appeared after update to Xcode 10.2. Is there any way to solve?
更多推荐
在iOS 12.2上使用PDFKit崩溃
发布评论