Saturday, May 14, 2011

NSString stringWithCharacters example

[NSString stringWithCharacters example] Following code fragment shows how to use NSString:stringWithCharacters method. It's used to create an NSString object from an C array of unicode characters. [NSString stringWithCharacters example]


const unichar myCharacters[] = {0x03C3,'x','x'};
NSString *myString = [NSString stringWithCharacters: myCharacters
                   length: sizeof myCharacters / sizeof *myCharacters];