I get a bunch of dates from a server in YYYY-MM-DD NSString format which we immediately stick into core data for accessing. However, I need to do a sorted fetch request with a greater than date predicate. How can I say “date greater than X” when date is a string instead of a date object?
AKA, start below is NSString, not NSDate
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"(start <= %@) AND (name == %@)", currentTime, name];
Instead of storing the dates as strings, and then having to sort the strings, parse the dates with an NSDateFormatter, then store them as NSDates in core data, then you can do all sorts of predicates with them with relative ease.