我有以下代码
NSDate * selectedDate = self.datePicker.date;
NSLog(@"The date selected is %@ and initialdate is %@", selectedDate, initialDate);
NSLog(@"the expression value is %i", [self.initialDate isEqualToDate:selectedDate]);,它将打印以下内容
The date selected is 2012-09-24 18:49:04 +0000 and initialdate is 2012-09-24 18:49:04 +0000
the expression value is 0我使用的是xcode4.5,目标是ios6。xcode4.4中的相同代码打印1(它们是相等的)
发布于 2012-09-25 03:44:36
这样啊,原来是这么回事。
当我添加下面这行代码时
NSLog(@"Initaldate with time intervel since 1970 %f and selecteddate %f", [initialDate timeIntervalSince1970], [selectedDate timeIntervalSince1970]);它在iOS 5中打印相同的值,但在iOS6中打印不同的值。
https://stackoverflow.com/questions/12571057
复制相似问题