• 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
Re: Objective-C coding question..
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Objective-C coding question..


  • Subject: Re: Objective-C coding question..
  • From: Carter Allen <email@hidden>
  • Date: Wed, 21 Jul 2010 17:36:21 -0600

NSDictionary instances cannot contain anything except subclasses of NSObject. You can set/retrieve BOOL values like so:

// Setting
[self setKey4:[NSNumber numberWithBool:boolValue]];

// Retrieving
BOOL widget = [[temp objectForKey:@"strKey4"] boolValue];

Hope that helps!

- Carter Allen

On Jul 21, 2010, at 5:29 PM, Clark Williams wrote:

Suppose you have a NSDictionary* instance called temp.
You've setup everything including the plist. The plist consists of:
KeyName ValueType
numKey0 NSNumber
strKey1 NSString
strKey2 NSString
strKey3 NSString
strKey4 BOOL+
<code_fragment_begins>
Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Objective-C coding question.. (From: Clark Williams <email@hidden>)

  • Prev by Date: Objective-C coding question..
  • Next by Date: Re: Objective-C coding question..
  • Previous by thread: Objective-C coding question..
  • Next by thread: Re: Objective-C coding question..
  • Index(es):
    • Date
    • Thread