How do I get the current date in Cocoa

后端 未结 14 511
醉酒成梦
醉酒成梦 2020-12-04 09:39

I\'m getting started developing for the iPhone and as such I am looking at different tutorials online as well as trying some different things out myself. Currently, I\'m try

14条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-04 10:26

    NSDate* now and NSDate *now are the same thing: a pointer to an NSDate object.

    You probably want to use descriptionWithCalendarFormat:timeZone:locale: rather than dateWithCalendarFormat: — the latter returns an NSCalendarDate, which the docs say is scheduled to be deprecated at some point.

提交回复
热议问题