如何在 Xcode 7 OSX 中创建 NSRadioButton 组

How to create NSRadioButton Group in Xcode 7 OSX(如何在 Xcode 7 OSX 中创建 NSRadioButton 组)
本文介绍了如何在 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 组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Why local notification is not firing for UNCalendarNotificationTrigger(为什么没有为UNCalendarNotificationTrigger触发本地通知)
Pushing UIViewController above UITabBar(将UIView控制器推送到UITabBar上方)
Dropbox Files.download does not start when number of files in folder is gt; 1000(当文件夹中的文件数为1000时,Dropbox Files.Download不会启动)
appearance().setBackgroundImage Not Working On Custom Class(外观().setBackoundImage在自定义类上不起作用)
Show/Hide barButtonItem(显示/隐藏barButtonItem)
java.lang.IllegalStateException: SimpleTypeImpl should not be created for error type(异常:不应为错误类型创建SimpleTypeImpl)