iOS 13:@objc VC.navigationController(_:willShow:animated :):违反线程:预期主线程 [英] iOS 13: @objc VC.navigationController(_:willShow:animated:) : threading violation: expected the main thread
问题描述
当隐藏特定ViewController的NavigationBar时,我仅在iOS 13用户上遇到了Crashlytics of Fabric崩溃的情况。
I got the crash on Crashlytics of Fabric only for iOS 13 users when the NavigationBar of the particular ViewController is being hidden.
我尝试通过隐藏特定的NavigationBar的方法使用NavigationController的委托方法的ViewController
I tried by hiding the NavigationBar for particular ViewController by using NavigationController's delegate method
func navigationController(_ navigationController: UINavigationController, willShow viewController: UIViewController, animated: Bool) {
let hide = (viewController is MyVC)
navigationController.setNavigationBarHidden(hide, animated: animated)
}
但它也会在称为crashp的crashlytics上产生崩溃
But it also generating the crash on crashlytics called
Fatal Exception: NSInternalInconsistencyException
threading violation: expected the main thread
推荐答案
I得到了上述问题的解决方案,
I got a solution for the above issue,
我使用Xcode 10.2.1上传了应用程序的版本,但现在没有崩溃。
I used Xcode 10.2.1 to upload the build of the app, and I didn't get any crashes now.
这篇关于iOS 13:@objc VC.navigationController(_:willShow:animated :):违反线程:预期主线程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!