Is there a way to specify argument position/index in NSString stringWithFormat?

NSString and CFString support reorderable/positional arguments.

NSString *string = [NSString stringWithFormat: @"Second arg: %2$@, First arg %1$@", @"<1111>", @"<22222>"];
NSLog(@"String = %@", string);

Also, see the documentation at Apple: String Resources

Leave a Comment