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

Capture and play voice with Asterisk ARI -

c++ - Can not find the "fiostream.h" file -

java - Why database contraints in HSQLDB are only checked during a commit when using transactions in Hibernate? -