• 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: Boolean Values in a plist
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Boolean Values in a plist


  • Subject: Re: Boolean Values in a plist
  • From: "James W. Walker" <email@hidden>
  • Date: Sun, 23 May 2010 20:49:24 -0700

On May 23, 2010, at 8:23 PM, Dale Miller wrote:

> I need to use the parameters obtained from a plist (via NSPropertyListSerialization). I can get the process to work quite well, except that I have to use in my code an undocumented class: NSCFBoolean.
> Determining that the returned object is of class NSCFBoolean is the only way I've been able to determine that I have a Boolean value.

I'm not absolutely sure, but I think that toll-free bridging would let you do this:

CFGetTypeID( (CFTypeRef) value ) == CFBooleanGetTypeID()

Experimentally, it works.  That is, CFGetTypeID( (CFTypeRef) [NSNumber numberWithFloat: 3.5] ) returns the same value as CFNumberGetTypeID(), whereas CFGetTypeID( (CFTypeRef) [NSNumber numberWithBool: YES] ) returns the same value as CFBooleanGetTypeID().

_______________________________________________

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

References: 
 >Boolean Values in a plist (From: Dale Miller <email@hidden>)

  • Prev by Date: Boolean Values in a plist
  • Next by Date: Re: Boolean Values in a plist
  • Previous by thread: Boolean Values in a plist
  • Next by thread: Re: Boolean Values in a plist
  • Index(es):
    • Date
    • Thread