首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >iOS应用程序在VisionKit框架iOS 13中崩溃

iOS应用程序在VisionKit框架iOS 13中崩溃
EN

Stack Overflow用户
提问于 2019-10-15 12:59:45
回答 1查看 434关注 0票数 3

我使用VisionKit框架来捕获iOS 13中引入的文档,这是一个非常好的捕获文档的框架。但是在这个框架中,导航栏上有两个按钮,导航条上有(Retake )。当我点击那些应用程序时会崩溃,原因如下:

由于异常“NSInternalInconsistencyException”而终止应用程序,原因:“应用程序名为-statusBar或-statusBarWindow on UIApplication:由于不再有状态栏或状态栏窗口,必须更改此代码。请在窗口场景中使用statusBarManager对象。”

我试图通过将preferredStatusBarUpdateAnimation返回为false来做到这一点。但它并没有解决。

这是代码片段:-

代码语言:javascript
复制
import UIKit
import VisionKit

class DetectDocumentViewController: UIViewController, VNDocumentCameraViewControllerDelegate {

    override func viewDidLoad() {
        super.viewDidLoad()

    }

    @IBAction func tapMeAction(_ sender: UIButton) {
        let vc = VNDocumentCameraViewController()
        vc.delegate = self
        present(vc, animated: true)
    }

    func documentCameraViewController(_ controller: VNDocumentCameraViewController, didFinishWith scan: VNDocumentCameraScan) {
        print("Found \(scan.pageCount)")

        for i in 0 ..< scan.pageCount {
            let img = scan.imageOfPage(at: i)
            print(img)
            // ... your code here
        }
        controller.dismiss(animated: true, completion: nil)
    }

    func documentCameraViewControllerDidCancel(_ controller: VNDocumentCameraViewController) {
        controller.dismiss(animated: true)
    }

    func documentCameraViewController(_ controller: VNDocumentCameraViewController, didFailWithError error: Error) {
        print(error)
        controller.dismiss(animated: true)
    }
}

有没有办法解决这个问题,防止它崩溃?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-10-18 06:24:08

这是iOS 13的内部问题。现在它已经在iOS 13.1中解决了,请在iOS 13.1中运行您的项目。会很好的。请检查iOS 13错误修复程序。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58395320

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档