![]() |
CFStringCreateWithFormatAndArguments | Header: CFString.h |
Creates an immutable CFString object from a formatted string and a variable number of arguments (specified in a parameter of type va_list).
CFStringRef CFStringCreateWithFormatAndArguments ( CFAllocatorRef alloc, CFDictionaryRef formatOptions, CFStringRef format, va_list arguments );
Pass a reference to an allocator to be used to create the CFString object or pass NULL to request the default allocator.
Pass a reference to a CFDictionary object containing formatting options for the string (such as the thousand-separator character, which is dependent on locale). Currently, these options are an unimplemented feature.
Pass a reference to a CFString object that contains a string with printf-style specifiers.
Pass a variable of type va_list that is initialized to point to the list of variable values to be inserted into the formatted string contained in the object referenced by format.
A reference to an immutable CFString object or NULL if there was a problem creating the object.
The CFStringCreateWithFormatAndArguments creates a CFString object from another CFString object containing a formatted string and a list of arguments specified by a pointer variable of type va_list. A formatted string is one with printf-style format specifiers embedded in the text such as %d (decimal), %f (double), and %@ (Core Foundation object). The subsequent arguments, in order, are substituted for the specifiers in the character data contained by the created object. You can also reorder the arguments in the string by using modifiers of the form"$n" with the format specifiers (for example, %$2d. These modifiers allow you to easily localize formatted strings by reading them from resources or property-list files.
For more information on supported specifiers, see the relevant section in "Core Foundation String Services Tasks." The programming interface for variable argument lists (va_list, va_start, va_end, and so forth) is declared in the standard C header file stdarg.h.