绑定 NSPopupbutton 的菜单项的 Enabled

问题描述

我有一个 NSPopupButton。

我有一个 NSArrayController ('obsCommandsArrayController') 包含一堆 'obscommand' 对象,如下所示:

class obscommand: NSObject {
    @objc var name: String
    @objc var menuEnabled: Bool
}

在 IB 中,我点击设置绑定,并设法使用其相应对象的“名称属性填充弹出按钮。

在附加的屏幕截图中,您会看到此成功绑定标记为绿色

enter image description here

现在,我想启用弹出按钮的菜单项。按照我的逻辑,标记为红色的绑定应该处理这个问题,但它会导致

this class is not key value coding-compliant for the key this class is not key value coding-compliant for the key arrangedobjects

崩溃

你知道我做错了什么吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)