简体   繁体   English

在界面生成器中使用 SideMenu 窗格时,“此 class 不符合键值编码”

[英]“this class is not key value coding-compliant” when using SideMenu pod in interface builder

I am using SideMenu pod.我正在使用 SideMenu 吊舱。 While the app is functioning normally I am getting an error of当应用程序正常运行时,我收到一个错误

Failed to set (leftSide) user defined inspected property on (UINavigationController): [<UINavigationController 0x7fa9f7816000> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key leftSide.无法在 (UINavigationController) 上设置 (leftSide) 用户定义的检查属性:[<UINavigationController 0x7fa9f7816000> setValue:forUndefinedKey:]:此 class 不符合键 leftSide 的键值编码。

In the attribute inspector, I have leftNav set to ON.在属性检查器中,我将 leftNav 设置为 ON。 I am not sure what am I missing here, or what to do with the leftNav key.我不确定我在这里缺少什么,或者如何使用 leftNav 键。 I do not have any unwanted connections.我没有任何不需要的连接。

    private func setupSideMenu() {

        let lnav = storyboard?.instantiateViewController(withIdentifier: "LeftMenuNavigationController") as? SideMenuNavigationController
        // I set it a second time. lnav?.leftSide = true 
        lnav?.leftSide = true 
        lnav?.statusBarEndAlpha = 0
        lnav?.presentationStyle = .viewSlideOutMenuIn
        lnav?.presentationStyle.backgroundColor = .white
        lnav?.presentationStyle.presentingEndAlpha = 0.5

        // Define the menus
        SideMenuManager.default.leftMenuNavigationController = lnav
        SideMenuManager.default.rightMenuNavigationController = nil

        SideMenuManager.default.addPanGestureToPresent(toView: navigationController!.navigationBar)
        SideMenuManager.default.addScreenEdgePanGesturesToPresent(toView: view, forMenu: .left)
        
    }

The “this class is not key value coding-compliant” error almost always means that you are trying to set a property of a custom subclass in your storyboard or XIB file in Interface builder, but forgot to change the class of your object to the custom class. The “this class is not key value coding-compliant” error almost always means that you are trying to set a property of a custom subclass in your storyboard or XIB file in Interface builder, but forgot to change the class of your object to the custom class。 It's easy to get this error if you use "user defined runtime attributes" to set properties on your objects, but don't set the class of the object correctly.如果您使用“用户定义的运行时属性”来设置对象的属性,但没有正确设置 object 的 class,则很容易出现此错误。

I'd have to look at the project - and specifically it's Storyboards/XIB files, to find the problem, but that's very likely what's going on.我必须查看该项目——特别是它的 Storyboards/XIB 文件,才能找到问题所在,但这很可能是正在发生的事情。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM