iphone - How do i set placeholder char(%)? -
Objective-c ... I want to represent placeholder character (%) but my code is not ... .
NSString * base = @ "style type = \" test / css \ "& gt; div {width: 100 \%} & lt; / style & gt; & lt; body & Gt;% @ "; NSString * html = [NSString stringWithFormat: base, @ "hello world"]; NSLog (@ "% @", HTML); 100%} Actual: div {width: 100} is what
- That's wrong?
Try this:
NSString * base = @ "& Lt ; Style = type = \ "test / css \" & gt; div {width: 100 %%} & lt; / style & gt; & lt; body & gt;% @ & lt; / body & gt; ";
The complete list of format specifiers is.
Comments
Post a Comment