Passing a string representing my format specifier into stringWithFormat and seeing issues

Posted by Jeff on Stack Overflow See other posts from Stack Overflow or by Jeff
Published on 2010-05-26T01:35:31Z Indexed on 2010/05/26 1:41 UTC
Read the original article Hit count: 345

Filed under:
|
|

If I call "[NSString stringWithFormat:@"Testing \n %@",variableString]"; I get what I would expect, which is Testing, followed by a new line, then the contents of variableString.

However, if i try NSString *testString = @"Testing \n %@"; //forgive shorthand here [NSString stringWithFormat,testString,variableString]

the output actually literally writes \n to the screen instead of a newline. any workaround to this? seems odd to me

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c