iOS Reference Library Apple Developer
Search

Deprecated NSDateFormatter Methods

A method identified as deprecated has been superseded and may become unsupported in the future.

Available in iOS 2.0 through iOS 3.2

init

Initializes and returns an NSDateFormatter instance. (Available in iOS 2.0 through iOS 3.2.)

- (id)init

Return Value

An NSDateFormatter instance initialized with locale, time zone, calendar, and behavior set to the appropriate default values.

Discussion

There are many new attributes you can get and set on a 10.4-style date formatter, including the locale, time zone, calendar, format string, the two-digit-year cross-over date, the default date which provides unspecified components, and there is also access to the various textual strings, like the month names. You are encouraged, however, not to change individual settings. Instead you should accept the default settings established on initialization and specify the format using setDateStyle:, setTimeStyle:, and appropriate style constants (see NSDateFormatterStyle—these are styles that the user can configure in the International preferences panel in System Preferences).

Special Considerations

If you want the Mac OS X 10.4 behavior but have not set the class’s default behavior to NSDateFormatterBehavior10_4, you also need to send the new instance a setFormatterBehavior: message with the argument NSDateFormatterBehavior10_4.

Availability
  • Available in iOS 2.0 through iOS 3.2.
Declared In
NSDateFormatter.h



Last updated: 2009-04-26

Did this document help you? Yes It's good, but... Not helpful...