Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone how to write symbol on a label?

I am going to develop the iPhone app. But I got stuck with one place. I want to write some symbol on the label from the xib file.

The symbols are not on the keyboard but we can get it by the ASCII value.

e.g: the ACSII value for the character sign "mue" is 230 but how to print that symbol "mue" on the label that i dont know.

So please help me for that.

Thanks in advance.

like image 392
Shreyash Mahajan Avatar asked Dec 04 '22 04:12

Shreyash Mahajan


2 Answers

Use whatever editor you like to produce that character, and open your xib in XCode and just copy/paste it in?

like image 185
Clafou Avatar answered Dec 18 '22 16:12

Clafou


Use NSUTF8StringEncoding to encode your string.

For example,

NSString *str = [NSString stringWithUTF8String:"your string for encoding"];

[lblName setText:str];

Following function will also help :

- (NSString *) decodedString:(NSString *) originalString {
    NSString *newString = [NSString stringWithUTF8String:[originalString cStringUsingEncoding:[NSString defaultCStringEncoding]]];
    return newString;
}

I suggest to use above function.

like image 21
Devang Avatar answered Dec 18 '22 15:12

Devang