Instance Method

isValidDateInCalendar:

Returns a Boolean value that indicates whether the current combination of properties represents a date which exists in the specified calendar.

Declaration

- (BOOL)isValidDateInCalendar:(NSCalendar *)calendar;

Parameters

calendar

The calendar for which to use in the calculation.

Return Value

YES if the date corresponding to the receiver's values is valid and exists in the given calendar, otherwise NO.

Discussion

If the timeZone property is set on the receiver, the time zone property value is used.

This property should not be used for NSDateComponents objects that represent relative quantities of calendar components. To find the the next or previous date that matches a particular set of date components, use the NSCalendar instance method nextDateAfterDate:matchingUnit:value:options: instead.

See Also

Validating a Date

validDate

A Boolean value that indicates whether the current combination of properties represents a date which exists in the current calendar.

date

The date calculated from the current components using the stored calendar.

Undefined Components

Constants that denote that the value of a date component is undefined.