UIDatePicker and NSDate

前端 未结 3 1657
抹茶落季
抹茶落季 2021-01-14 14:06

I have an NSDate that I get from a UIDatepicker.

IBOutlet UIDatePicker *dueDate;
NSDate *selectedDate = [dueDate date];

How do I retrieve t

3条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-14 14:18

    use -[NSCalendar components:fromDate:] for instance the example here:

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

提交回复
热议问题