I need a function which receives [NSDate date] and a string @"2010-11-12" and returns the amount of days between those two dates.
More explanation: I need to store a date from a server in the format @"2010-11-12" in my NSUserdefaults. The meaning of this date is the expireDate of a feature in an iPhone App. Every time I pres开发者_运维问答s on a button for this feature I need to check if the difference in days between the current time->[NSDate date] and @"2010-11-12" is greater than 0. That means that the feature is disabled.
It's making me crazy, maybe it's dead simple.
Use an NSDateFormatter to convert the string to an NSDate - then compare the date objects.
精彩评论