BOOL value in Dictionary
BOOL value in Dictionary
- Subject: BOOL value in Dictionary
- From: "Richard S. French" <email@hidden>
- Date: Fri, 21 Nov 2008 08:48:05 -0500
- Thread-topic: BOOL value in Dictionary
How does one get a boolean value from a dictionary object?
My XML dictionary contains the value </true> under the given key.
Should this be retrieved as NSNumber or some other object?
I am trying to set the state of a checkbox button based on the value as
below:
// return syntax coloring switch
BOOL *colorSwitch = NO;
colorSwitch = [NSNumber numberWithBOOL:[temp
objectForKey:@"BBLMColorsSyntax"]];
NSLog(@"Color: %@", colorSwitch);
if ( colorSwitch == YES) {
[colorBox setState:NSOnState];
}
else {
[colorBox setState:NSOffState];
}
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden