NSDatePicker Class Reference
| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/AppKit.framework |
| Availability | Available in OS X v10.4 and later. |
| Declared in | NSDatePicker.h |
Overview
NSDatePicker is a subclass of NSControl that provides a user interface for displaying and editing an NSDate object.
NSDatePicker uses an NSDatePickerCell to implement much of the control’s functionality. NSDatePicker provides cover methods for most of NSDatePickerCell methods, which invoke the corresponding cell method.
Tasks
Configuring Date Pickers
-
– isBezeled -
– setBezeled: -
– isBordered -
– setBordered: -
– backgroundColor -
– setBackgroundColor: -
– drawsBackground -
– setDrawsBackground: -
– textColor -
– setTextColor: -
– datePickerStyle -
– setDatePickerStyle: -
– delegate -
– setDelegate: -
– datePickerElements -
– setDatePickerElements:
Controlling Date Picker Range and Mode
-
– calendar -
– setCalendar: -
– locale -
– setLocale: -
– datePickerMode -
– setDatePickerMode: -
– timeZone -
– setTimeZone:
Accessing Object Values
Constraining the Displayable/Selectable Range
Instance Methods
backgroundColor
Returns the background color of the receiver.
Return Value
The background color of the receiver.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSDatePicker.hcalendar
Returns the calendar used by the receiver.
Return Value
The calendar used by the receiver.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSDatePicker.hdatePickerElements
Returns a bitmask that indicates which visual elements of the date picker are currently shown, and which won't be usable because they are hidden.
Return Value
A bitmask that specifies the date picker elements displayed by the receiver. See “Constants” in NSDatePickerCell for a description of the possible values.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSDatePicker.hdatePickerMode
Returns the receiver’s date picker mode.
Return Value
The receiver’s date picker mode.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSDatePicker.hdatePickerStyle
Returns the receiver’s date picker style.
Return Value
The receiver’s date picker style.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSDatePicker.hdateValue
Returns the receiver’s date.
Return Value
The receiver’s date.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSDatePicker.hdelegate
Returns the delegate of the receiver’s date picker cell.
Return Value
The delegate of the receiver’s date picker cell.
Discussion
The date picker’s NSDatePickerCell instance handles all delegate methods.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSDatePicker.hdrawsBackground
Returns whether the receiver draws the background.
Return Value
TRUE if the receiver draws the background, FALSE otherwise.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSDatePicker.hisBezeled
Returns whether the receiver has a bezeled border.
Return Value
TRUE if the receiver has a bezeled border, FALSE otherwise.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSDatePicker.hisBordered
Returns whether the receiver has a plain border.
Return Value
TRUE if the receiver has a plain border, FALSE otherwise.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSDatePicker.hlocale
Returns the receiver’s locale.
Return Value
The receiver’s locale.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSDatePicker.hmaxDate
Returns the maximum date value the receiver allows as input.
Return Value
The maximum date value the receiver allows as input. nil indicates no maximum date.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSDatePicker.hminDate
Returns the minimum date value the receiver allows as input.
Return Value
The minimum date value the receiver allows as input. nil indicates no minimum date.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSDatePicker.hsetBackgroundColor:
Sets the receiver’s background color.
Parameters
- color
The new background color.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSDatePicker.hsetBezeled:
Specifies whether the receiver draws a bezeled border.
Parameters
- flag
TRUEif the receiver has a bezeled border,FALSEotherwise.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSDatePicker.hsetBordered:
Specifies whether the receiver draws a plain border.
Parameters
- flag
TRUEif the receiver has a plain border,FALSEotherwise.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSDatePicker.hsetCalendar:
Sets the receiver’s calendar.
Parameters
- newCalendar
The new calendar.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSDatePicker.hsetDatePickerElements:
Sets a bitmask that indicates which visual elements of the date picker are currently shown, and which won't be usable because they are hidden.
Parameters
- elementFlags
A bitmask that specifies the date picker elements displayed by the receiver. See “Constants” in
NSDatePickerCellfor a description of the possible values.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSDatePicker.hsetDatePickerMode:
Sets the receiver’s date picker mode.
Parameters
- newMode
The new date picker mode.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSDatePicker.hsetDatePickerStyle:
Sets the receiver’s date picker style.
Parameters
- newStyle
The new date picker style.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSDatePicker.hsetDateValue:
Sets the receiver’s date to a new starting value.
Parameters
- newStartDate
The new starting date.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSDatePicker.hsetDelegate:
Sets the delegate of the receiver’s date picker cell.
Parameters
- anObject
The new delegate.
Discussion
The date picker’s NSDatePickerCell instance handles all delegate methods.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSDatePicker.hsetDrawsBackground:
Specifies whether the receiver draws the background.
Parameters
- flag
TRUEif the receiver draws the background,FALSEotherwise.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSDatePicker.hsetLocale:
Sets the receiver’s locale.
Parameters
- newLocale
The new locale.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSDatePicker.hsetMaxDate:
Sets the maximum date allowed as input by the receiver.
Parameters
- date
The maximum date allowed as input by the receiver.
nilindicates no maximum date.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSDatePicker.hsetMinDate:
Sets the minimum date allowed as input by the receiver.
Parameters
- date
The minimum date allowed as input by the receiver.
nilindicates no minimum date.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSDatePicker.hsetTextColor:
Sets the text color of the receiver.
Parameters
- color
The new text color.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSDatePicker.hsetTimeInterval:
Sets the time interval of the date range.
Parameters
- newTimeInterval
The new time interval.
Discussion
The time interval only applies when the receiver is in the NSRangeDateMode mode.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSDatePicker.hsetTimeZone:
Sets the receiver’s time zone.
Parameters
- newTimeZone
The new time zone.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSDatePicker.htextColor
Returns the text color of the receiver.
Return Value
The text color of the receiver.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSDatePicker.htimeInterval
Returns the time interval that represents the date range.
Return Value
The time interval that represents the receiver’s date range. The date range begins at the date returned by dateValue. This method returns 0 when the receiver is not in the NSRangeDateMode mode.
Special Considerations
Prior to OS X v 10.5, this method always returned 0.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSDatePicker.htimeZone
Returns the receiver’s time zone.
Return Value
The receiver’s time zone.
Availability
- Available in OS X v10.4 and later.
See Also
Declared In
NSDatePicker.h© 2008 Apple Inc. All Rights Reserved. (Last updated: 2008-06-09)