views:

365

answers:

3

Per

http://developer.apple.com/iphone/library/documentation/Cocoa/Reference/Foundation/Classes/NSDateFormatter_Class/Reference/Reference.html

The init method of NSDateFormatter is "Available in iPhone OS 2.0 through iPhone OS 3.2", and therefore not in 4.0. Now, it certainly works, but this seems odd. Is this is a mistake or is there some other way to create a NSDateFormatter?

A: 

I use the init method in an multiple iOS4 apps and they are approved and in the store. I can think of no way to get it to work so it would seem like its just a typo on the docs.

AtomRiot
A: 

The example code in the class reference still uses the init method, so I'd say its safe to use it in your own code.

macatomy
+9  A: 

This deprecation is just apple cleaning up the headers for NSDateFormatter. init is already declared in NSObject which NSNumberFormatter inherits from. Redeclaring is not necessary, however in the implementation apple will override init as subclassess should provide implementations for the default initializer of the superclass.

falconcreek