if ([[NSUserDefaults preferences] check box]==true) ?
if ([[NSUserDefaults preferences] check box]==true) ?
- Subject: if ([[NSUserDefaults preferences] check box]==true) ?
- From: Kurt Marek <email@hidden>
- Date: Sat, 8 Nov 2003 18:27:46 -0800
I have set up a prefs pane using the new defaults controller. I'm
trying to figure out if a check box is true of false, but I can't
figure out how to test the condition. I've always set these up
programatically to switch a boolean, but I'm not really sure how the
defaults controller sets the value. If I send the value to NSLog it
comes back as true or false.
I've tried all of the following and none of them seem to work:
if ([[NSUserDefaults standardUserDefaults]
objectForKey:@"checkBox"]==1)
if ([[NSUserDefaults standardUserDefaults]
objectForKey:@"checkBox"]==true)
if ([[NSUserDefaults standardUserDefaults]
objectForKey:@"checkBox"]==YES)
if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"checkBox"]
isEqual:@"true")
Can someone help me out here?
Kurt
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.