gpt4 book ai didi

iOS 10 - 导航栏 NSInternalInconsistencyException

转载 作者:行者123 更新时间:2023-11-30 11:51:22 26 4
gpt4 key购买 nike

导致崩溃的方法:

override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
self.navigationController?.setNavigationBarHidden(false, animated: false) // <- Line the crash happens
}

崩溃描述:

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Please file a radar on UIKit if you see this assertion.

<小时/>

请注意,此崩溃仅出现在 iOS 10 上。在 iOS 11 上运行时,代码按预期运行。有人遇到过这个问题或者有人知道任何解决方法吗?

最佳答案

我的 AppDelegate 中有以下行导致了问题。

UIBarButtonItem.appearance(whenContainedInInstancesOf: [UINavigationBar.self]).title = ""

去掉这个解决了 iOS 10 的问题。

关于iOS 10 - 导航栏 NSInternalInconsistencyException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48291040/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com