DRYな備忘録

Don't Repeat Yourself.

【iOS】Timestamp to NSDate Object

Goal

  • Get NSDate instance from timestamp-like NSInteger

Solution

  • Use dateWithTimeIntervalSince1970 method of NSDate
NSDate *d = [NSDate dateWithTimeIntervalSince1970:timestamp];

DRY