Instance Method


Returns the next date after a given date matching the given components.


- (NSDate *)nextDateAfterDate:(NSDate *)date matchingComponents:(NSDateComponents *)comps options:(NSCalendarOptions)options;



The date for which to perform the calculation.


The date components to match.


Options for the calculation. For possible values, see NSCalendarOptions.

Return Value

A new NSDate object.


To compute a sequence of dates, use the enumerateDatesStartingAfterDate:matchingComponents:options:usingBlock: method instead of calling this method in a loop with the previous loop iteration's result.

See Also

Scanning Dates

- startOfDayForDate:

Returns the first moment of a given date as a date instance.

- enumerateDatesStartingAfterDate:matchingComponents:options:usingBlock:

Computes the dates that match (or most closely match) a given set of components, and calls the block once for each of them, until the enumeration is stopped.

- nextDateAfterDate:matchingHour:minute:second:options:

Returns the next date after a given date that matches the given hour, minute, and second, component values.

- nextDateAfterDate:matchingUnit:value:options:

Returns the next date after a given date matching the given calendar unit value.


The options for arithmetic operations involving calendars.


A legacy constant used to control overflow in date calculations.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software