FROM : Dietrich Epp
DATE : Tue Jan 14 23:13:56 2003
On Tuesday, January 14, 2003, at 01:08 , Renaud Boisjoly wrote:
> Hi again
>
> Ok, I think it will work, but I do have a last newbie question to ask
> if I can...
>
> I've managed to convert from the UniChar result to an NSString, but I'm
> not clear on how to efficiently do the reverse. My original string is
> in an NSString and I guess I need to convert it to UniChar... but being
> pretty unexperienced, this looks like a mystery to me. Do I need to
> iterate through each character using characterAtIndex and add them to
> characters[] one by one? Should I use an NSScanner? Is there an
> immensely obvious way to do this and I'm just not seeing it (probably).
> I now its probably something I should know, but considering I've only
> been programming for a year or so except for stuff like AppleScript, I
> miss a lot of things.
>
> My current idea is a for loop using characterAtIndex to add each
> character...
Try one of the following NSString methods:
- (void)getCharacters:(unichar *)buffer
- (void)getCharacters:(unichar *)buffer range:(NSRange)aRange
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
DATE : Tue Jan 14 23:13:56 2003
On Tuesday, January 14, 2003, at 01:08 , Renaud Boisjoly wrote:
> Hi again
>
> Ok, I think it will work, but I do have a last newbie question to ask
> if I can...
>
> I've managed to convert from the UniChar result to an NSString, but I'm
> not clear on how to efficiently do the reverse. My original string is
> in an NSString and I guess I need to convert it to UniChar... but being
> pretty unexperienced, this looks like a mystery to me. Do I need to
> iterate through each character using characterAtIndex and add them to
> characters[] one by one? Should I use an NSScanner? Is there an
> immensely obvious way to do this and I'm just not seeing it (probably).
> I now its probably something I should know, but considering I've only
> been programming for a year or so except for stuff like AppleScript, I
> miss a lot of things.
>
> My current idea is a for loop using characterAtIndex to add each
> character...
Try one of the following NSString methods:
- (void)getCharacters:(unichar *)buffer
- (void)getCharacters:(unichar *)buffer range:(NSRange)aRange
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.






Cocoa mail archive

