Question

i'm trying to add a UNICODE character to NSString in this ways:

NSString *euFormatted = [NSString stringWithFormat:@"\u200A%@",self.eu];

or

unichar hairspaceChar = 0x200A; // hairspace symbol
NSString* hairSpace = [[NSString alloc] initWithCharacters:&hairspaceChar length:1];
NSString *euFormatted = [NSString stringWithFormat:@"%@%@",hairSpace,self.eu];

But not results ... i try to find a solution but is making me crazy since 3 days.

I have try also to set the Font of UILabel that show the string like that:

bigFont = [UIFont fontWithName:@"Helvetica" size:10.0f];

but no way, the HAIRSPACE is not supported.

here a screenshot if what i see, the HAIRSPACE suppose to be after the NUMBER 10 and BEFORE the '°' character.

enter image description here

Était-ce utile?

La solution 2

Found solution: Apple supported Characters and row UTF8 Characters

The HAIRSPACE is too small, i will go for Punctuation Space that is a bit Bigger and visible,

Autres conseils

If i try

NSLog(@"%@", [NSString stringWithFormat:@"-\u200A-"]);

i get '- -'.

second example will not work.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top