Skip navigation.
 
mlRe: how to write programatically greek letters to an NSTextField?
FROM : Clark Cox
DATE : Wed Dec 22 21:17:00 2004

On Wed, 22 Dec 2004 13:17:00 +0100, Nestor Cardozo <<email_removed>> wrote:
> I am trying to write programatically a combination of greek and latin
> characters to an NSTextField:
>
> [theNSTextField setStringValue:@"σxx"]


One cannot use non-ASCII characters in @"foo" string literals. You
have several options:
1) Use NSLocalizedString to load your Unicode string from a .strings file
2) Explicitly use character values in the source code:
NSString *myString = [NSString stringWithUTF8String: "\xCF\x83xx"];

or:

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

or:

NSString *myString = [NSString stringWithFormat: @"%Cxx", 0x03C3];


--
Clark S. Cox III
<email_removed>
http://www.livejournal.com/users/clarkcox3/
http://homepage.mac.com/clarkcox3/

Related mailsAuthorDate
mlhow to write programatically greek letters to an NSTextField? Nestor Cardozo Dec 22, 13:17
mlRe: how to write programatically greek letters to an NSTextField? Brian Bergstrand Dec 22, 15:12
mlRe: how to write programatically greek letters to an NSTextField? Evan Schoenberg Dec 22, 20:09
mlRe: how to write programatically greek letters to an NSTextField? Clark Cox Dec 22, 21:17
mlRe: how to write programatically greek letters to an NSTextField? The Karl Adam Dec 22, 23:31
mlRe: how to write programatically greek letters to an NSTextField? Clark Cox Dec 22, 23:46
mlRe: how to write programatically greek letters to an NSTextField? The Karl Adam Dec 23, 07:08
mlRe: how to write programatically greek letters to an NSTextField? Clark Cox Dec 24, 00:25