Instance Method

annotatedStringFromPersonNameComponents:

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

Declaration

- (NSAttributedString *)annotatedStringFromPersonNameComponents:(NSPersonNameComponents *)components;

Parameters

components

A formatted string representation of the given name components.

Return Value

An attributed string representation of the given name components. You can determine the person component corresponding to a particular range of the attributed string by querying the NSPersonNameComponentKey attribute, providing one of the NSPersonNameComponent constant values defined below as the attribute value.

Discussion

Use this method to style individual components of a formatted name, such as a name in a label.

See Also

Converting Between Person Name Components and Strings

+ localizedStringFromPersonNameComponents:style:options:

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

- stringFromPersonNameComponents:

Returns a string formatted for a given NSPersonNameComponents object.

- 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.