In the AppKit release notes for OS X 10.10, Apple wrote:
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.
Which is all well and good, but managing a radio group is annoying when using standalone buttons.
I searched for suggestions from others on how to handle this, to avoid having to set the state for each button separately, find the selected radio, etc, but couldn't find much discussion of it. I guess most people are waiting for Apple to formally deprecate NSMatrix, and hopefully provide a better mechanism.
So, answering my own question, I added some methods to my DejalAppKitCategories open source project to make this easier, and thought I'd share here for anyone else who wants to avoid
NSMatrixnow.Here's the header:
And the implementation:
To use these methods, simply invoke on any of the radios in the group, e.g.
And:
I hope this helps others! And, of course, if I'm missing anything obvious, or you have any suggestions or comments, please let me know.