Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

i.yalovecky

macrumors member
Original poster
Feb 24, 2010
67
0
I have unicode code of symbol, for example 2605, how i can display it in NSTextField, thanks.
 
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];
 
Another option is:

Code:
[theTextField setStringValue:[NSString stringWithFormat:@"Twinkle, twinkle, little %C", 0x2605]];
 
Or use \u - for example this
Code:
@"Print\u2026"
will give
Code:
@"Print…"
 
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.