Re: if ([[NSUserDefaults preferences] check box]==true) ?
Re: if ([[NSUserDefaults preferences] check box]==true) ?
- Subject: Re: if ([[NSUserDefaults preferences] check box]==true) ?
- From: Kurt Marek <email@hidden>
- Date: Sat, 8 Nov 2003 19:33:39 -0800
Thanks. That works wonderfully. I knew it was something silly.
Kurt
On Nov 8, 2003, at 9:36 PM, Kevin Wojniak wrote:
Try using...
if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"checkBox"]
boolValue])
...Kevin
On Nov 8, 2003, at 6:27 PM, Kurt Marek wrote:
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.
_______________
www.kainjow.com
aim: kainjow1
_______________________________________________
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.
_______________________________________________
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.