Mac Developer Library

Developer

AppKit Framework Reference NSDatePickerCellDelegate Protocol Reference

Options
Deployment Target:

On This Page
Language:

NSDatePickerCellDelegate

Inheritance


Not Applicable

Import Statement


Swift

import AppKit

Objective-C

@import AppKit;

Availability


Available in OS X v10.6 and later.

The NSDatePickerCellDelegate protocol defines the optional methods implemented by delegates of NSDatePickerCell objects.

  • The delegate receives this message each time the user attempts to change the receiver‘s value, allowing the delegate the opportunity to override the change.

    Declaration

    Swift

    optional func datePickerCell(_ aDatePickerCell: NSDatePickerCell, validateProposedDateValue proposedDateValue: AutoreleasingUnsafeMutablePointer<NSDate?>, timeInterval proposedTimeInterval: UnsafeMutablePointer<NSTimeInterval>)

    Objective-C

    - (void)datePickerCell:(NSDatePickerCell *)aDatePickerCell validateProposedDateValue:(NSDate **)proposedDateValue timeInterval:(NSTimeInterval *)proposedTimeInterval

    Parameters

    aDatePickerCell

    The cell that sent the message.

    proposedDateValue

    On input, contains the proposed new date. The delegate may change this value before returning.

    proposedTimeInterval

    On input, contains the proposed new time interval. The delegate may change this value before returning.

    Discussion

    When returning a new proposedDateValue, the NSDate instance should be autoreleased, and the proposedDateValue should not be released by the delegate.

    The proposedDateValue and proposedTimeInterval are guaranteed to lie between the dates returned by minDate and maxDate. If you modify these values, you should ensure that the new values are within the appropriate range.

    Import Statement

    Objective-C

    @import AppKit;

    Swift

    import AppKit

    Availability

    Available in OS X v10.4 and later.

    Available as part of an informal protocol prior to OS X v10.6.