在iOS 12.2上使用PDFKit崩溃 [英] Crash with PDFKit on iOS 12.2
问题描述
在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上创建了一个小项目,该项目在 https://上演示了崩溃github.com/rudedogdhc/crash-pdfview-ios12.2
I have created a tiny project on github which demonstrates the crash at https://github.com/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
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崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!