I am trying to concatenate two strings with NSString initWithFormat, and I am getting garbage output. Here is my code:
userLabel.text = [NSString stringWithFormat:@"@%s",[[tweets objectAtIndex:0] screen_name]];
The output should be something like this – “@username”, while at the moment it is coming out like this – “@`;á”. Is there an escape sequence I need to use to display an @ symbol correctly in an NSString?
If
screen_nameis anNSString, use"@%@"format. The%sformat is for C strings.