开发者

NSSuperscriptAttributeName show error?

I am trying to create a subscripted text in iphone using NSMutableAttributedString. But the "NSSup开发者_开发百科erscriptAttributeName" show some error " undeclared identifier ". How can i solve it?

NSDictionary * superscriptAttrs = [NSDictionary dictionaryWithObject:[NSNumber numberWithInt:1] 
                                                                  forKey:NSSuperscriptAttributeName];
    NSAttributedString * st = [[NSAttributedString alloc] initWithString:@"st"
                                                              attributes:superscriptAttrs];


Assuming that you're on iOS, you need to use a different set of constants which you can find here.

In your case NSSuperscrptAttributeName should be kCTSuperscriptAttributeName.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜