Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想将 NSButton 的启用状态绑定到 NSArrayController 是否有任何选定的项目。
我该怎么做呢?
另一种选择是绑定到selectedObjects.@count
selectedObjects.@count
一般来说,将enabled绑定绑定到canRemove数组控制器的属性应该会给你你想要的。毕竟,只有选中了一个对象,您才能删除一个对象。
enabled
canRemove
这是IB的答案:
如果您需要设置与其他 NSArrayController(或其他值)的 OR 关系,则有 Enabled 2 部分,依此类推。所以,就我而言,我有: