Type Method

localizedStringFromPersonNameComponents:style:options:

Returns a string formatted for a given NSPersonNameComponents object using the provided style and options.

Declaration

+ (NSString *)localizedStringFromPersonNameComponents:(NSPersonNameComponents *)components style:(NSPersonNameComponentsFormatterStyle)nameFormatStyle options:(NSPersonNameComponentsFormatterOptions)nameOptions;

Parameters

components

The name components to be formatted.

nameFormatStyle

A format style for the name components. For possible values, see NSPersonNameComponentsFormatterStyle.

nameOptions

The formatting options for the name components. For possible values, see NSPersonNameComponentsFormatterOptions.

Return Value

A formatted string representation of the given name components.

Discussion

This method is a convenience for formatting name components without creating an instance of NSPersonNameComponentsFormatter. For greater customizability, you can create an instance of NSPersonNameComponentsFormatter and use stringFromPersonNameComponents: instead.

See Also

Converting Between Person Name Components and Strings

- stringFromPersonNameComponents:

Returns a string formatted for a given NSPersonNameComponents object.

- annotatedStringFromPersonNameComponents:

Returns an attributed string formatted for a given NSPersonNameComponents object, with attribute annotations for each component.

- personNameComponentsFromString:

Returns a person name components object from a given string.

- getObjectValue:forString:errorDescription:

Returns by reference a person name components object after creating it from a given string.