initWithFormat:locale:
Returns an NSString object initialized by using a given format string as a template into which the remaining argument values are substituted according to given locale.
Declaration
- (instancetype) initWithFormat:(NSString *) format locale:(id) locale;Parameters
- format:
A format string. See 20000943 for examples of how to use this method, and TP40004265 for a list of format specifiers. This value must not be
nil. - locale:
An Nslocale object specifying the locale to use. To use the current locale, pass
[NSLocale currentLocale]. To use the system locale, passnil.For legacy support, this may be an instance of
NSDictionarycontaining locale information.
Discussion
Pass comma-separated list of trailing variadic arguments to substitute into format.
Invokes init(format:locale:arguments:) with locale as the locale.
See Also
Creating and Initializing Strings
stringinit()init(bytes:length:encoding:)init(bytesNoCopy:length:encoding:freeWhenDone:)init(characters:length:)init(charactersNoCopy:length:freeWhenDone:)init(string:)initWithFormat:init(format:arguments:)init(format:locale:arguments:)init(data:encoding:)stringWithFormat:localizedStringWithFormat:localizedUserNotificationString(forKey:arguments:)stringWithCharacters:length: