Я пытаюсь заставить пользователя выбрать дату в будущем с помощью выбора даты. Я, очевидно, использовал метод compare: однако, когда я делаю следующий код, даже если он имеет ту же дату, что и [NSDate date], он сообщает, что выполняет оператор if. Вот мой код:
    if ([datePicker.date compare:[NSDate date]] == NSOrderedAscending) // If the picked date is earlier than today
{
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Hmm, this date is earlier than today" 
                                                    message:@"The date you've selected is earlier than today date, please pick another" 
                                                   delegate:nil  
                                          cancelButtonTitle:@"Okay, I'll pick another" 
                                          otherButtonTitles:nil];
    // Show the alert
    [alert show];
    // Release the alert
    [alert release];
}
