Re: NSMutableString, NSString ,character for character
Re: NSMutableString, NSString ,character for character
- Subject: Re: NSMutableString, NSString ,character for character
- From: Markus Hitter <email@hidden>
- Date: Fri, 13 Jul 2001 13:06:22 +0200
Am Freitag, 13. Juli 2001 um 03:23 schrieb Michel Haver:
Question:
If you try to do something hard like writing your first cocoa
application,
some simple C stuff becomes mind boggling in cocoa
Maybe it's easier than you think if you're used to use microsteps in
plain C ;-)
, so here is my question:
NSString * drawString;
drawString = @"test";
How do I get the characters t e s t in this NSString?
You can always convert an NSString to an plain C-string:
char *newString = [drawString cString];
However, you should try to avoid using plain C strings. NSStrings can
hold more than just single-byte characters. These additions are lost
when doing the conversion.
There are a big bunch of operations for all common tasks on strings, you
find most of them at the Foundation/NSString and Foundation/NSScanner
documentation.
Markus
- - - - - - - - - - - - - - - - - - -
Dipl. Ing. Markus Hitter
http://www.jump-ing.de/