【问题标题】:Xcode 14 UINavigationBar issueXcode 14 UINavigationBar 问题
【发布时间】:2022-12-22 14:16:59
【问题描述】:

更新 Xcode 后,我在控制台中看到消息:

[Assert] UINavigationBar decoded as unlocked for UINavigationController, or navigationBar delegate set up incorrectly. Inconsistent configuration may cause problems. 

而我在 Navigation Controller 场景中的所有数据都没有显示。 我试图将它放在 SceneDelegate 上,但没有帮助:

self.window?.rootViewController = navigationVC 
self.window?.makeKeyAndVisible()

我应该怎么做才能解决这个问题?

【问题讨论】:

    标签: swift xcode uinavigationcontroller uikit uinavigationbar


    【解决方案1】:

    我也在研究这个错误。如果有任何进展,我会在这里更新。我还面临另一个例外:

    _UINavigationBarContentViewLayout valueForUndefinedKey:
    this class is not key value coding-compliant for the key inlineTitleView.
    

    应该是iOS 16的bug,和Xcode版本无关。

    还有很多人也遇到过这个问题:https://developer.apple.com/forums/thread/714278

    一个临时解决方案是使用代码而不是故事板来创建导航控制器。

    【讨论】:

      【解决方案2】:

      重新启动您的 Mac 并删除主类上不必要的功能

      【讨论】:

        猜你喜欢
        • 2022-08-12
        • 2023-03-29
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多