如何在 Xcode 7 OSX 中创建 NSRadioButton 组 [英] How to create NSRadioButton Group in Xcode 7 OSX

查看:38
本文介绍了如何在 Xcode 7 OSX 中创建 NSRadioButton 组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在关注 :

<块引用>

Interface Builder 对象库中的单选按钮模板现在实现为单独的 NSButton 对象,而不是旧的 NSMatrix,在 OS X v10.8 及更高版本上不鼓励使用.当单选按钮具有相同的 superview 和 -action 方法时,它们会自动作为一个组(选择一个按钮将取消选择所有其他相关按钮).(16965941)

因此,拖动单个单选按钮并确保将它们全部连接到同一个插座!

I was following this tutorial on how to create radio button group. But it seems Radio Group is no longer available in the Xcode 7 library and I didn't find much information about it. How do I create something like this:

Thanks very much.

解决方案

Quoting from the Xcode 7 release notes:

The template for Radio buttons in the Interface Builder object library is now implemented as individual NSButton objects, rather than the older NSMatrix, which is discouraged on OS X v10.8 and later. Radio buttons automatically act as a group (selecting one button will unselect all other related buttons) when they have the same superview and -action method. (16965941)

So drag individual radio buttons and make sure you connect them all to the same outlet!

这篇关于如何在 Xcode 7 OSX 中创建 NSRadioButton 组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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