ios - NSString stringWithFormat less parameters -


we need format string, localisations won't output parameters. seems doesn't work output less parameters passed:

nsstring *string = [nsstring stringwithformat: @"%2$@", @"<1111>", @"<22222>"]; nslog(@"string = %@", string); 

outputs

string = <1111> 

although output second parameter. bug or feature?

according related industrial standard, ieee specification:

when numbered argument specifications used, specifying nth argument requires leading arguments, first (n-1)th, are specified in format string.


which means in other words, must use first %1$@ parameter in string formatter somewhere before address use second 1 – so, not bug @ all.


Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

css - Can I use the :after pseudo-element on an input field? -