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

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


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

  • Prev by Date: Re: Strange int behavour
  • Next by Date: Application unique/specific font question
  • Previous by thread: Re: Strange int behavour
  • Next by thread: Fwd: Strange int behavour
  • Index(es):
    • Date
    • Thread