Re: NSButton (Switch)
Re: NSButton (Switch)
- Subject: Re: NSButton (Switch)
- From: Scott Anguish <email@hidden>
- Date: Thu, 16 Aug 2001 02:56:36 -0400
On Friday, August 17, 2001, at 02:35 AM, stuartbryson wrote:
I have implemented a NSButton from within IB. It is a Switch or
Checkbox. Accessing it via an oultet in my controller, I don't know how
to test if it is Checked or Ticked. I tried intValue and also state
from NSButton but neither work, they all return 0 regardless of what I
beleive is its state.
to set it to a specific value (yes, no)
[activateCheckBox setIntValue:1]; (checked)
to get the value, use intValue
are you sure that you have it set up as a checkbox?
This is what I have in one of my action targets (when you click on the
checkbox, it calls this.. it just sets a default)
- (void)activateChanged:(id)sender;
{
[[NSUserDefaults standardUserDefaults] setBool:([sender intValue] ==
1) forKey:@"ActivateOnDragAndDrop"];
}
do you have the item in IB hooked up to a variable (an outlet?)