Contents

CFStringAppendFormatAndArguments(_:_:_:_:)

Appends a formatted string to the character contents of a CFMutableString object.

Declaration

func CFStringAppendFormatAndArguments(_ theString: CFMutableString!, _ formatOptions: CFDictionary!, _ format: CFString!, _ arguments: CVaListPointer)

Parameters

  • theString:

    The string to which the formatted characters from format are appended. If this value is not a CFMutableString object, an assertion is raised.

  • formatOptions:

    A dictionary containing formatting options for the string (such as the thousand-separator character, which is dependent on locale). Currently, these options are an unimplemented feature.

  • format:

    A formatted string with printf-style specifiers.

  • arguments:

    List of values to be inserted in format.

Discussion

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 appended to theString. You can also reorder the arguments in the string by using modifiers of the form “n$” with the format specifiers (for example, %2$d).

For more information on supported specifiers, see the relevant section in String Programming Guide for Core Foundation.

See Also

CFMutableString Miscellaneous Functions