• 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
Fwd: Strange int behavour
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Strange int behavour (From: d2kagw <email@hidden>)
 >Re: Strange int behavour (From: Hank Heijink <email@hidden>)
 >Re: Strange int behavour (From: Hank Heijink <email@hidden>)

  • Prev by Date: Re: Cocoa-dev Digest, Vol 4, Issue 74
  • Next by Date: Re: Setting the application Icon
  • Previous by thread: Re: Strange int behavour
  • Next by thread: Re: Strange int behavour
  • Index(es):
    • Date
    • Thread