Instance Method

getObjectValue:forString:range:error:

Returns by reference a date representation of a given string and the range of the string used, and returns a Boolean value that indicates whether the string could be parsed.

Declaration

- (BOOL)getObjectValue:(out id  _Nullable *)obj forString:(NSString *)string range:(inout NSRange *)rangep error:(out NSError * _Nullable *)error;

Parameters

obj

If the receiver is able to parse string, upon return contains a date representation of string.

string

The string to parse.

rangep

If the receiver is able to parse string, upon return contains the range of string used to create the date.

error

If the receiver is unable to create a date by parsing string, upon return contains an NSError object that describes the problem.

Return Value

YES if the receiver can create a date by parsing string, otherwise NO.

Discussion

See Also

Converting Objects

- dateFromString:

Returns a date representation of a given string interpreted using the receiver’s current settings.

- stringFromDate:

Returns a string representation of a given date formatted using the receiver’s current settings.

+ localizedStringFromDate:dateStyle:timeStyle:

Returns a string representation of a given date, formatted for the current locale using the specified date and time styles.