• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
BOOL value in Dictionary
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: BOOL value in Dictionary
      • From: Graham Cox <email@hidden>
    • Re: BOOL value in Dictionary
      • From: Ken Thomases <email@hidden>
  • Prev by Date: Re: Autorelease Question
  • Next by Date: Re: BOOL value in Dictionary
  • Previous by thread: Re: Problem archiving/unarchiving object graph containing NSMutableArray
  • Next by thread: Re: BOOL value in Dictionary
  • Index(es):
    • Date
    • Thread