开发者

NSSuperscriptAttributeName show error?

开发者 https://www.devze.com 2023-03-29 20:28 出处:网络
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

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

精彩评论

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