为什么如果我绑定到 NSPathControl,它会显示为灰色?
我通过值转换器绑定了 NSPathControl 的值,该转换器将字符串转换为我的模型的 URL(NSMutableDictionaries 的 NSMutableArray)。我已经设置了控件的目标/操作。
绑定到位后,控件即可工作,在表选择更改时显示模型的路径。但是,它呈灰色且不接受点击。这是为什么呢?
如果我在代码中明确将路径控制设置为“启用”,则没有任何区别。
如果我删除绑定,它会显示我在 IB 中给出的任何路径,它不会灰显,并且接受点击并运行我的操作。
我没有使用路径控件的启用绑定。我应该这样吗?
我使用的是 Xcode 4 和 10.6。
I have bound the value of an NSPathControl through a value transformer that converts strings to URLs to my model (a NSMutableArray of NSMutableDictionaries). I have the control's target/action set up.
With the binding in place the control works, showing the path from my model as my table selection is changed. However, it is grayed out and does not accept clicks. Why is this?
If I explicitly set the path control to enabled to YES in code, it makes no difference.
If I remove the binding, it shows whatever path I give it in IB, it is not grayed out, and clicks are accepted and run my action.
I am not using the Enabled binding of the path control. Should I be?
I'm using Xcode 4 and 10.6.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
答案是“Conditionally Sets Enabled”已打开(默认设置)。关闭它似乎已经修复了它。为绑定的不透明度加上另一张粉笔。
The answer turned out to be that Conditionally Sets Enabled was turned on (the default). Turning that off appears to have fixed it. Chalk another one up for bindings opacity.