Strange int behavour
Strange int behavour
- Subject: Strange int behavour
- From: d2kagw <email@hidden>
- Date: Wed, 24 Jan 2007 09:04:40 +1100
hi all,
I'm having some really strange issues with converting a NSString to
an int.
Examine the following peice of code, and
// declared elsewhere
NSString * theKey = @"A23456789";
// problem code
NSString * ttSession = [theKey substringWithRange:NSMakeRange( 1,
( [theKey length] - 1 ) )];
NSLog ( @"%@ == %i", ttSession, [ttSession intValue] );
now I was hoping that it would result in this
"23456789 == 23456789"
but instead I get
"23456789 == 2147483647"
and just to make it totally confusing, if I change "theKey" to
something different I still get "2147483647" as the value???
im totally stumped, and im sure its going to be something totally
silly like "you forgot a comma" or something :D
Cheers
Az
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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