Re: NSString to ascii code
Re: NSString to ascii code
- Subject: Re: NSString to ascii code
- From: Nick Zitzmann <email@hidden>
- Date: Mon, 17 Jan 2005 01:26:01 -0700
On Jan 17, 2005, at 1:13 AM, Peter Karlsson wrote:
Dear list!
I have a NSString like this:
NSString *myString = @"A";
I want to get the ascii code 65 from myString, how do I do that in
Cocoa?
Dear Peter! <;*)
Use the -[NSString characterAtIndex:] method with the proper index
number, which would be 0 in the case of the string you mentioned. Don't
use -cString as someone else suggested, because Apple has repeatedly
stated that the method will soon be deprecated.
Nick Zitzmann
<http://www.chronosnet.com/>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden