Instance Method

getObjectValue:forString:errorDescription:

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

Declaration

- (BOOL)getObjectValue:(out id  _Nullable *)obj forString:(NSString *)string errorDescription:(out NSString * _Nullable *)error;

Parameters

obj

On return, contains an instance of NSPersonNameComponents, or nil if conversion failed.

string

A string that is parsed to create a person name components object.

error

If an error occurs, upon return contains an NSError object in the NSCocoaErrorDomain with code NSFormattingError that explains why the conversion failed. If you pass in nil for error, you are indicating that you are not interested in error information.

Return Value

YES if conversion succeeded; otherwise NO.

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.

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