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 (%%).
精彩评论