Re: Strange int behavour
Re: Strange int behavour
- Subject: Re: Strange int behavour
- From: Hank Heijink <email@hidden>
- Date: Tue, 23 Jan 2007 17:22:32 -0500
Whoops, spoke too soon. Sorry about that - %i is equivalent to %d in
Cocoa (consulted an old C manual before scratching my head and
referring to Apple's docs).
When I try your code though, I do get the right result (i.e. the
numeric value following 'A'). The value that you get looks like the
contents of an uninitialized variable to me. Is this really the
actual code that produced your output?
Hank
On Jan 23, 2007, at 5:11 PM, Hank Heijink wrote:
// declared elsewhere
NSString * theKey = @"A23456789";
// problem code
NSString * ttSession = [theKey substringWithRange:NSMakeRange( 1,
( [theKey length] - 1 ) )];
NSLog ( @"%@ == %i", ttSession, [ttSession intValue] );
Hank Heijink
www.hankheijink.com
email@hidden
_______________________________________________
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