NSMatrix简单绑定问题 [英] NSMatrix simple binding question

查看:74
本文介绍了NSMatrix简单绑定问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试一个示例应用程序,在其中已进行以下控制:

I am trying a sample application in which I have taken following controls:

i。 NSMatrix(具有2个元素,用作单选按钮)

i. NSMatrix (with 2 elements, serving as radio button)

ii。按钮(单击该按钮会根据所选的单选按钮生成操作)

ii. Button (which when clicked generates action based on radio button selected)

我的问题是-


在IB中,我们可以将
NSMatrix的每个按钮单元格绑定到单个bool变量
表示firstElementValue,这样当
用户选择
中的第一个按钮单元格时NSMatrix,当用户在NSMatrix中选择第二个按钮单元
时,firstElementValue为YES和
,firstElementValue为NO。

In IB, can we bind each button cell of NSMatrix to a single bool variable, say- firstElementValue, such that when user selects first button cell in NSMatrix, firstElementValue is YES and when user selects second button cell in NSMatrix, firstElementValue is NO.


还有其他有效方法可以使
实现这一目标吗?

Is there any other effective way to achieve this ?

请提出建议。

谢谢

Miraaj

推荐答案

我通过将NSNegateBoolean设置为单选按钮单元格之一的值转换器来解决它:)

I resolved it by setting NSNegateBoolean as value transformer for one of the radio button cells :)

这篇关于NSMatrix简单绑定问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆