我比较了 2 个相同的 NSDates,我得到了错误的结果。我不能展示我是如何得到这个日期的,因为它太长了,但我可以展示我做了什么:
NSLog(@"this date is:%@ , and date we check to equality is:%@",thisDate,dateToFind);
if([thisDate isEqualToDate:dateToFind] )
{
NSLog(@"equal date!"); // not printed!
}
NSLog 给我看这个:
this date is:2012-09-13 14:23:54 +0000 , and date we check to equality is:2012-09-13 14:23:54 +0000
他不打印 NSLog 。为什么 ?