NSNumber stringValue not returning correct value
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