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
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,
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)
>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
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