Reworking the view controller to have a bunch of outlets to buttons is what I 
am trying to avoid. The original implementation simply bound the radio group 
(NSMatrix) either to a numeric property or to an object property on the model. 
The code Sean McBride provided shows the lengths one has to go to in order to 
approximately replace the binds offered by NSMatrix. Again, I am not opposed to 
the work, but it does seem like a giant leap backwards from the simplicity of 
simply using the bindings available with NSMatrix. Secondly, while the 
documentation does state that the new radio behavior works for apps “linked on 
10.8” it appears from my own experimentation that this behavior does not extend 
backwards to older versions of AppKit just because the app was linked on 10.8 
and I, unfortunately, still need to support back to 10.6. The documentation in 
the IB editor seems more accurate:

“For apps running on 10.8 and later, creating radio groups with individual 
NSButton objects (rather than an NSMatrix) is preferred."

Thus any replacement code I use/develop has to take the differing behavior of 
NSRadioButton into account. Again a giant leap backwards IMO.

FWIW: the only real documentation outside of headers and the WWDC sessions is 
in the AppKit 10.8 release notes:

https://developer.apple.com/library/mac/releasenotes/AppKit/RN-AppKitOlderNotes/#X10_8Notes

Look for the section under NSButton / NSButtonCell (sorry there is no direct 
anchor). For convenience I quote:

“An NSButton configured as a radio button (with the -buttonType set to 
NSRadioButton), will now operate in a radio button group for applications 
linked on 10.8 and later. To have the button work in a radio group, use the 
same -action for each NSButton instance, and have the same superview for each 
button. When these conditions are met, checking one button (by changing the 
-state to 1), will uncheck all other buttons (by setting their -state to 0).”

The announcement of deprecation is in the AppKit 10.10 release notes:

https://developer.apple.com/library/mac/releasenotes/AppKit/RN-AppKitOlderNotes/#X10_10Notes

Look for the section under NSMatrix (sorry again there is no direct anchor). 
For convenience I again quote:

“ Use of NSMatrix is informally deprecated. We expect to add the formal 
deprecation macros in a subsequent release, but its use is discouraged in the 
mean time. The primary use of NSMatrix is for radio button groups, so recall 
that for applications linked on 10.8 or later, radio buttons that share the 
same parent view and action will operate as a group."

> On Apr 8, 2016, at 3:33 AM, dangerwillrobinsondan...@gmail.com wrote:
> 
> It's hard to find. 
> asciiwwdc site makes it discoverable. 
> As far as I can tell it was only there (so in a video) but might be in some 
> release notes though those often don't show up in searches. 
> The programming guide docs are generally woefully out of date for controls 
> that don't come inside of a scroll view inherently. 
> 
> But you've added to it being searchable by this thread!
> 
> Sent from my iPhone
> 
> On Apr 8, 2016, at 8:34 AM, Graham Cox <graham....@bigpond.com 
> <mailto:graham....@bigpond.com>> wrote:
> 
>> Also, they have to all be subviews of the same parent view.
>> 
>> Strangely, I can’t find anything in the documentation about this, but it 
>> most definitely works

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to