• 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: PList Data Typing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PList Data Typing


  • Subject: Re: PList Data Typing
  • From: Kevin Bracey <email@hidden>
  • Date: Tue, 16 Dec 2014 11:37:18 +1300

Thanks Jens,

You’re fantastic!

Have a great holiday season to all, and thanks for all the help over the years!

On 16/12/2014, at 11:28 am, Jens Alfke <email@hidden> wrote:

>
>> On Dec 15, 2014, at 2:10 PM, Kevin Bracey <email@hidden> wrote:
>>
>> How can I tell if the Value is a Boolean or Number in the NSDictionary? as 0 and 1 are valid values for a number.
>
> There's no clean solution for this. You have to take advantage of the fact that the YES and NO NSNumbers are singleton objects, and do a direct pointer comparison (with ==, *not* with isEqual:) —
>
> if (obj == @YES) {
> 	it's YES
> } else if (obj == @NO) {
> 	it's NO
> } else {
> 	it's a number (possibly 0 or 1)
> }
>
> —Jens


_______________________________________________

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: 
 >PList Data Typing (From: Kevin Bracey <email@hidden>)
 >Re: PList Data Typing (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: PList Data Typing
  • Next by Date: Re: PList Data Typing
  • Previous by thread: Re: PList Data Typing
  • Next by thread: Re: PList Data Typing
  • Index(es):
    • Date
    • Thread