开发者

' % ' symbol was not printing on objective-c [duplicate]

This question already has answers here: 开发者_JAVA百科 Closed 11 years ago.

Possible Duplicate:

How to add percent sign to NSString

I am trying to print red (10.0 %) in Objective-C using the statement:

    $ newlabel1.text= [[NSString alloc] initWithFormat:@"red (%.1f %)",rv];

However, I am getting red(10.0) only, and the % symbol was not printing. How can I make the percentage symbol print?


You should double the percent sign (%%).

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜