Andrew
Andrew

Reputation: 3892

Use Unicode In A UILabel

I have a UILabel, and I want a unicode character to be in it. I've seen this sample code in another app and it works perfectly; however, in my app, I get a blank square. Any help would be much appreciated!

[self.button setTitle:@"\uf05a" forState:UIControlStateNormal];

Upvotes: 2

Views: 199

Answers (1)

CodaFi
CodaFi

Reputation: 43330

It is because the Chinese character contained in that Unicode escape is not a valid Unicode character. This means that while it may exist in the Unicode spec, it has yet to be implemented, or standardized, so UILabel cannot render it. Talk to a font designer and see about getting that glyph in a custom font package, or use a different one.

Upvotes: 2

Related Questions