In my app I have to compare two times: current (which is 12:44) and given I tried:
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatte
it means that in your case, neededDate is always higher than the current date. this is probably because you store a 48 hour string in a 24 hour format. change the string to HH:mm
also, verify the value you store in neededDate.
here's a small example
NSDate *neededDate = [[NSDate date] dateByAddingTimeInterval:5];
if ([neededDate compare:[NSDate date]] == NSOrderedAscending) {
NSLog(@"asc");
} else {
NSLog(@"dec");
}
in this case, dec will be printed.