当我使用字符串格式时,我可以多次访问一个参数而不再次传递它吗?
例子:
NSString *parameter1 = @"1";
NSString *parameter2 = @"2";
NSString *myString;
myString = [NSString stringWithFormat:@"I want to print parameter1 here: %@, parameter2 here: %@ and now access parameter1 again: %@ _without_ passing it again.",parameter1, parameter2, parameter1];
有没有办法再次访问第一个参数而无需再次写入“,parameter1”?