iPhone how to write symbol on a label?

6 Solutions Collect From Internet About “iPhone how to write symbol on a label?”

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

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.

I think you mean the character ‘µ’, yes?

If so, you can simply type it into the label by clicking “option” and “m” on your Macintosh keyboard, when you are editing the label in your XIB.

If you can use the unicode number instead, you can do it like this:

NSString *muString = [NSString stringWithFormat:@"%C", 0x03BC];

Write 0x then the unicode number.

Open the “Special Characters”-Panel and search for your character. You can find it at the bottom of the edit menu. There is a shortcut for it too, cmd+opt+t

Copy and paste your character from there to your UILabel.

and btw: option + m = µ

You can simply type into label by using ‘Alt’ key + ‘m’ key on key board, when you are editing the label in your XIB and rest of symbols, you can get easily using ‘Alt’ key and other keys. You can fix ‘Alt’ key and change other keys(one by one).