-3

I want to display n as subscript in my app when i am using unicode character for it a square is displayed on my simulator. want to display "bn" here n must be at subscript.this might be a basic question but i cant resolve this issue as i am developing my first app. please help me out of these Thanks in advance..

the code i tried is

    NSString * strstatic=@"\nb \u2099;
    GenEqn.text=[NSString stringWithFormat:@"Your Equation is ==> %@",strstatic];
Agent Chocks.
  • 1,312
  • 8
  • 19
  • Possible duplication of this question.. http://stackoverflow.com/questions/5080175/how-to-create-subscript-characters-thats-not-in-unicode-in-ios – Praveen Kumar Apr 30 '13 at 12:49
  • Use NSAttributedString, You can refer this question http://stackoverflow.com/questions/8555735/how-to-make-subscripts-and-superscripts-using-nsattributedstring – Prasad Devadiga Apr 30 '13 at 12:51

2 Answers2

0

I would open up OS X's character viewer and drag the character straight into Xcode. It turns out it actually works!

Undo
  • 25,519
  • 37
  • 106
  • 129
0

You can only use characters that are available in the font you're using. You'll either need to change font to one that has the character or change the character you're using.

Check this for adding custom fonts: Can I embed a custom font in an iPhone application?

Alternatively use NSAttributedString (Possibly with a library like DTCoreText depending on what versions of iOS you need to support) to specify the the text layout / formatting.

Community
  • 1
  • 1
Wain
  • 118,658
  • 15
  • 128
  • 151