如何在UILabel中将第三个幂/立方体字符的上标显示为字符串?

roh*_*tel 4 iphone objective-c ipad ios

我正试图找到它的解决方案并混淆了如何在UILabel中显示第三个电源/立方体.我试图在之前提出的问题中找到答案,但没有一个是有用的.

我试图得到答案的问题:

如何对节目 - 标 - 用于注册符号

UILabel和上标

如果我必须使用unichars,我如何将它们用于Superscripts?

谢谢..

jrt*_*ton 18

您需要为上标三个包含unicode符号:

NSInteger number = 10;
NSString *cubedSymbol = @"\u00B3";
NSString *tenCubed = [NSString stringWithFormat:@"%d%@",number,cubedSymbol];
Run Code Online (Sandbox Code Playgroud)

这里有更多的乐趣