• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Sample code programmatically create radio button matrix [general techniques]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Sample code programmatically create radio button matrix [general techniques]


  • Subject: Sample code programmatically create radio button matrix [general techniques]
  • From: "Erik M. Buck" <email@hidden>
  • Date: Wed, 6 Oct 2004 18:18:52 -0400

Thanks to Scott Anguish and Stepwise for hosting this sample.

http://graphics.stepwise.com/EMB/RadioSample.zip

In response to a previous request on Apple's Cocoa-dev list for a sample of how to create a matrix of radio buttons programmatically, I just wrote the following little sample with commented source code in an Xcode project.

There are countless little samples out there already. Here is one more with my spin on the techniques.

// This sample creates four radio button matrices using four different
// techniques:
// 1) Just do it in Interface Builder with no code
// 2) Copy and reposition the matrix previously configured in IB
// 3) Configure a custom view previously positioned in IB
// 4) Build up the matrix from scratch
//
// Note: There is almost never a reason to use techniques 3 and 4
// Note: Technique 2 is used by IB whenever entering "Run" mode
//  and a similar technique is used when any nib is loaded in any
//  application.
// Note: There is virtually nothing that IB can do that you can't do in code
//   because every user interaction within IB ends up calling code similar
//   to the code in techniques 3 and 4.  IB executes the code to configure a
//   "live" object.  When you save a nib file, the live objects with all of
//   their configuration (state) are archived.  When a nib is loaded, the
//   objects are unarchived and come alive again.  IB exists so that you
// don't have to write or maintain all the code in techniques 3 and 4.  At least
// use technique 2 in favor of techniques 3 and 4.
//

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
  • Prev by Date: Re: Using outlets from NSView subclass
  • Next by Date: Re: Using outlets from NSView subclass
  • Previous by thread: Re: Help with pixellated NSTIFFRepresentation issues much appreciated
  • Next by thread: Validating custom NSToolbarItems
  • Index(es):
    • Date
    • Thread