• 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
Re: radio Button newbie question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: radio Button newbie question


  • Subject: Re: radio Button newbie question
  • From: Steven Huey <email@hidden>
  • Date: Sat, 26 Apr 2008 07:51:26 -0400

Alli,

Off hand I'm not sure of any sample code, but if you're using the Radio Group from Interface Builder, you'll want to look at the documentation for the NSMatrix class.

http://developer.apple.com/documentation/Cocoa/Conceptual/Matrix/Matrix.html

In my code I typically set the "tag" values for each of the individual radio buttons within the NSMatrix instance, and then create an outlet in my controller like:

IBOutlet NSMatrix *myRadioGroup;

You can then get the text of the selected radio button using:

[[myRadioGroup selectedCell] title]

You can fetch a specific cell of the matrix using:

[myRadioGroup cellWithTag:3] // 3 is a tag value

You can programmatically select a specific cell using:

[myRadioGroup selectCellWithTag:3]

If that doesn't get you started or no one else has more sample code for you, contact me off list and I can probably come up with a quick code example for you.

Best regards,
Steven Huey

On Apr 26, 2008, at 6:38 AM, Allison Newman wrote:

Could somebody please put me out of my misery and tell me where I can find an example of using radio buttons in a Cocoa app please? Or better yet, a tutorial? I have just wasted several hours of my life trying to find one, because I can not make the sodding things to work!!

thanks,

Alli

-- Steven Huey Software - http://www.stevenhuey.com




_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden


References: 
 >radio Button newbie question (From: Allison Newman <email@hidden>)

  • Prev by Date: Re: Not showing window at Document-Based application
  • Next by Date: Debugger at odds with reality?
  • Previous by thread: radio Button newbie question
  • Next by thread: Re: radio Button newbie question
  • Index(es):
    • Date
    • Thread