1.属性列表
属性列表类包括:
简写成plist
NSArray,NSDictionary,NSString,NSNumber,NSDate,NSData及它们的变体。
2.NSDate 与 NSData
NSDate 获取当前日期和时间,是自动释放的对象。
获取与当前时间相隔的时间差
+ (id)dateWithTimeIntervalSinceNow:(NSTimeInterval)secs;
参数:
NSTimeInterval 是一个双精度参数,表示以秒为单位的时间间隔,正数为将来的时间,负数为过去的时间。
日期比较:
- (NSDate *)earlierDate:(NSDate *)anotherDate;//返回较早的日期
- (NSDate *)laterDate:(NSDate *)anotherDate;//返回较晚的日期
- (NSComparisonResult)compare:(NSDate *)other;
- (BOOL)isEqualToDate:(NSDate *)otherDate;//相同,返回yes
排序:
- (NSComparisonResult)compare:(NSDate *)other;
取时间间隔:
- (NSTimeInterval)timeIntervalSinceDate:(NSDate *)anotherDate;
- (NSTimeInterval)timeIntervalSinceNow;
- (NSTimeInterval)timeIntervalSince1970;
将时间表示成字符串:
- (NSString *)description;