Re: setState has no effect on an NSButton

2011-05-10 Thread David Duncan
On May 9, 2011, at 9:55 PM, Graham Cox wrote: > Why bother? Because it's more readable than all those if/else constructions, > and hence, less prone to bugs. Also, if( st == YES)...else if(st == NO) is > redundant - a BOOL can only be YES or NO. The optimiser might optimise away > the second co

Re: setState has no effect on an NSButton

2011-05-09 Thread Graham Cox
On 10/05/2011, at 11:19 AM, Martin Batholdy wrote: > BOOL st = [prefs boolForKey:@"optionA"]; > if(st == YES){ [buttonA setState:NSOnState]; } > else if(st == NO){ [buttonA setState:NSOffState]; } Apart from the advice already received,

Re: setState has no effect on an NSButton

2011-05-09 Thread Quincey Morris
On May 9, 2011, at 18:19, Martin Batholdy wrote: > -(void)awakeFromNib { > > prefs = [NSUserDefaults standardUserDefaults]; > > BOOL st = [prefs boolForKey:@"optionA"]; > if(st == YES){ [buttonA setState:NSOnState]; } > else if(st == NO)

Re: setState has no effect on an NSButton

2011-05-09 Thread Howard Siegel
>From those symptons, it certainly sounds like there is a missing/crossed connection in IB for those buttons or you are mising @property/@synthesize lines for those buttons. - h On Mon, May 9, 2011 at 18:19, Martin Batholdy wrote: > Hi, > > I have a preference window with four NSButtons that are

setState has no effect on an NSButton

2011-05-09 Thread Martin Batholdy
Hi, I have a preference window with four NSButtons that are all connected to a method and an IBOutlet: IBOutlet NSButton *buttonA; IBOutlet NSButton *buttonB; IBOutlet NSButton *buttonC; IBOutlet NSButton *buttonD; NSUserDefaults *prefs; Now I would like to set the state of these buttons accor