• 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
setting up radio buttons
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

setting up radio buttons


  • Subject: setting up radio buttons
  • From: Daniel Child <email@hidden>
  • Date: Wed, 19 Sep 2007 16:29:58 -0400

Hi All,

I am trying to set up a series of radio buttons. I have used matrices before, and they worked fine, but for some reason, I can't find any examples on how to get radio buttons to work.

I declared the radio button outlet as an NSButtonCell and connected the GUI to the instantiated controller object. But when I try to get the state, the values are wrong. For three buttons, titled TAB, COMMA, and OTHER, I get the following logs when attempting to get the state for all three.

<pressing tab and hitting a get state button>
2007-09-19 16:21:13.386 GenericParser[1436] The cell is 1
2007-09-19 16:21:13.386 GenericParser[1436] Cell title is Tab

<pressing comma and hitting the get state button>
2007-09-19 16:21:05.368 GenericParser[1436] The cell is 0
2007-09-19 16:21:05.368 GenericParser[1436] Cell title is Tab
(should be Comma)

<pressing other and hitting the get state button>
2007-09-19 16:21:09.157 GenericParser[1436] The cell is 0
2007-09-19 16:21:09.157 GenericParser[1436] Cell title is Tab
(should be Other)

Obviously the titles of the second and third buttons are not recognized, and the state is 1 for Tab no matter what and 0 for the others. My code is really a guess since I can't find documentation or examples.

int buttonState; // the radio button cell selected
NSString *radButtonTitle; // the title of the radio button selected

buttonState = [fieldDelimRadioButton state];
NSLog(@"The cell is %i\n", buttonState);
radButtonTitle = [fieldDelimRadioButton title];
NSLog(@"Cell title is %@\n", radButtonTitle);


At this point, if anyone knows of a good link to info on how to get and set the state of the button, I'd really appreciate. I can't seem to find any documentation or examples. Thanks very much.

Daniel
_______________________________________________

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


  • Follow-Ups:
    • Re: setting up radio buttons
      • From: Keary Suska <email@hidden>
    • Re: setting up radio buttons
      • From: Fritz Anderson <email@hidden>
  • Prev by Date: Re: Masking Tracking Rects
  • Next by Date: Looks KVC-compliant to me, but Cocoa says it ain't
  • Previous by thread: Re: Best way to programmatically cancel an NSError?
  • Next by thread: Re: setting up radio buttons
  • Index(es):
    • Date
    • Thread