在iOS 12.2上使用PDFKit崩溃

编程入门 行业动态 更新时间:2024-10-26 07:35:35
本文介绍了在iOS 12.2上使用PDFKit崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在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崩溃

本文发布于:2023-11-26 15:17:10,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1634244.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:iOS   PDFKit

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!