I i.yalovecky macrumors member Original poster Feb 24, 2010 67 0 May 31, 2010 #1 I have unicode code of symbol, for example 2605, how i can display it in NSTextField, thanks.
robbieduncan Moderator emeritus Jul 24, 2002 25,611 893 Harrogate May 31, 2010 #2 Something like this will get you an NSString. You should be able to do the rest (if you can't read the documentation): Code: unichar ch = 0x2605; NSString*str = [NSString stringWithCharacters:&ch length:1];
Something like this will get you an NSString. You should be able to do the rest (if you can't read the documentation): Code: unichar ch = 0x2605; NSString*str = [NSString stringWithCharacters:&ch length:1];
J jamawa macrumors newbie Jul 7, 2009 10 0 May 31, 2010 #3 Another option is: Code: [theTextField setStringValue:[NSString stringWithFormat:@"Twinkle, twinkle, little %C", 0x2605]];
Another option is: Code: [theTextField setStringValue:[NSString stringWithFormat:@"Twinkle, twinkle, little %C", 0x2605]];
K kainjow Moderator emeritus Jun 15, 2000 7,958 7 May 31, 2010 #4 Or use \u - for example this Code: @"Print\u2026" will give Code: @"Print "
robbieduncan Moderator emeritus Jul 24, 2002 25,611 893 Harrogate Jun 1, 2010 #5 The reason I used the solution I did is that some of the above depend on the source code file being UTF-8 and will break if it is not. Lot's of good discussion here.
The reason I used the solution I did is that some of the above depend on the source code file being UTF-8 and will break if it is not. Lot's of good discussion here.