Почему нельзя сравнить NSDate с помощью <или>?
NSDate *date = [NSDate date];
NSDateFormatter *dateFormat = [[NSDateFormatter alloc]init];
[dateFormat setDateFormat:@"MM/dd/yyyy"];
NSLog([@"today is " stringByAppendingString:[dateFormat stringFromDate:date]]);
NSLog([@"firstBirthdayDate is " stringByAppendingString:[dateFormat stringFromDate:firstBirthdayDate]]);
NSLog([@"secondBirthdayDate is " stringByAppendingString:[dateFormat stringFromDate:secondBirthdayDate]]);
if ([firstBirthdayDate isEqualToDate:secondBirthdayDate])
NSLog(@"First date is the same as second date");
if (firstBirthdayDate < date)
NSLog(@"First date is earlier than today");
else
NSLog(@"First date is later than today");
if (secondBirthdayDate < date)
NSLog(@"Second date is earlier than today");
Сегодня 11/08/2012firstBirthdayDate
это 23.01.2012secondBirthdayDate
это 23.01.2012Вот'Что я получаю в журнале:
Первая дата совпадает со второй датой
Первое свидание позже, чем сегодня
Второе свидание раньше, чем сегодня
Я думаю я'я схожу с ума ...