• 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
NSNumber stringValue not returning correct value
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSNumber stringValue not returning correct value


  • Subject: NSNumber stringValue not returning correct value
  • From: Ken Tozier <email@hidden>
  • Date: Fri, 21 Jan 2005 19:09:59 -0500

I'm defining some NSNumbers as unsigned like so:

NSNumber *aNum = [[NSNumber alloc] initWithUnsignedLong: 0xFFFFFFFF];

and checking the assignment like so

NSLog(@"aNum = %@", [aNum stringValue]);

Which prints

aNum = -1

The "stringValue" documentation specifically states that "...method invokes NSString’s <x-tad-bigger>initWithFormat:locale:</x-tad-bigger> method, supplying the format based on the type the NSNumber was created with"

So why isn't it returning 255 instead of -1?

Anyone point out what I'm doing wrong?

Thanks for any help

Ken
 _______________________________________________
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: NSNumber stringValue not returning correct value
      • From: Nick Zitzmann <email@hidden>
  • Prev by Date: Re: Authorization without permanent setuid on helper
  • Next by Date: Re: Why do "loose" nibs take precedence over nibs in .lproj?
  • Previous by thread: Re: index column in bound NSTableView
  • Next by thread: Re: NSNumber stringValue not returning correct value
  • Index(es):
    • Date
    • Thread