NSString object initialized by using a given format string as a template into which the remaining argument values are substituted according to given locale information. This method is meant to be called from within a variadic function, where the argument list will be available.
- iOS 2.0+
- macOS 10.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
A list of arguments to substitute into
NSString object initialized by using
format as a template into which values in
arg are substituted according the locale information in
locale. The returned object may be different from the original receiver.
The following Objective-C code fragment illustrates how to create a string from
my, which is derived from a string object with the value “Cost:” and an int with the value 32:
The resulting string has the value “
See String Programming Guide for more information.