tags:

views:

37

answers:

1

With the iOS SDK I need to find an easy and secure way to see if an NSDate is today, yesterday, tomorrow. What I'm looking for is something like this in pseudo code:

NSDate *myDate = someDate;
if ([myDate isTomorrow]) {
    NSLog("Tomorrow"); 
}

How would you solve it?

+1  A: 

Check our Erica Sadun's great NSDate extension class: http://github.com/erica/NSDate-Extensions

There are lots of date comparisons, among them exactly what you need :)

Canada Dev
Perfect! So nice to just be able to write [date isToday] :-)
mrrmatinsi