• 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: Do I know whether a NSNumber was created with +numberWithBool rather than a different +numberWithxx method?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Do I know whether a NSNumber was created with +numberWithBool rather than a different +numberWithxx method?


  • Subject: Re: Do I know whether a NSNumber was created with +numberWithBool rather than a different +numberWithxx method?
  • From: Gus Mueller <email@hidden>
  • Date: Wed, 1 Feb 2006 23:42:55 -0800

On Feb 1, 2006, at 10:29 PM, email@hidden wrote:
I am walking through a NSDictionary and have a variety of NSNumber objects. Some where created with +numberWithBool: and others were created with +numberWithInt:

Do I have any way to know whether that NSNumber represents a BOOL rather than an int?

I _think_ you can look at NSNumber's objCType.

It returns "f" for floats, "d" for doubles, "i" for integers (and longs), and "c" for booleans.

-gus

--
August 'Gus' Mueller
Flying Meat Inc.
http://flyingmeat.com/

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Do I know whether a NSNumber was created with +numberWithBool rather than a different +numberWithxx method?
      • From: email@hidden
References: 
 >Do I know whether a NSNumber was created with +numberWithBool rather than a different +numberWithxx method? (From: email@hidden)

  • Prev by Date: Do I know whether a NSNumber was created with +numberWithBool rather than a different +numberWithxx method?
  • Next by Date: Using Your Own Data Format in Core Data
  • Previous by thread: Do I know whether a NSNumber was created with +numberWithBool rather than a different +numberWithxx method?
  • Next by thread: Re: Do I know whether a NSNumber was created with +numberWithBool rather than a different +numberWithxx method?
  • Index(es):
    • Date
    • Thread