鉴于这一功能:比较同一日期返回OrderedAscending
func isLessThanDate(dateToCompare: NSDate) -> Bool {
var isLess = false
print(self)
print(dateToCompare)
if self.compare(dateToCompare) == NSComparisonResult.OrderedAscending {
isLess = true
}
return isLess
}
毫秒的差异可能。你是如何创建日期的? – Sulthan
它们是对象的更新日期,但我看不到毫秒差异,如何打印nsdate的毫秒以证明您的语句? – Godfather
'print(self.timeIntervalSince1970)'''print(dateToCompare.timeIntervalSince1970)' – luk2302