鑑於這一功能:比較同一日期返回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