Fwd: Strange int behavour
Fwd: Strange int behavour
- Subject: Fwd: Strange int behavour
- From: Azza <email@hidden>
- Date: Wed, 24 Jan 2007 15:27:55 +1100
---------- Forwarded message ----------
From: Azza <email@hidden>
Date: Jan 24, 2007 3:26 PM
Subject: Re: Strange int behavour
To: Hank Heijink <email@hidden>
You're on the ball there John, the value isn't actually the number i'd be
using cause its a system generated number would normally be over 5 billion.
My appologies for missing an informative part of the original post :P
On 1/24/07, Hank Heijink <email@hidden> wrote:
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