views:

157

answers:

2

I have three dates: (1) previousDate (2) currentDate (3) nextDate, I want to check whether currentDate is later then previous date and earlier than nextDate. How do I do that?

+3  A: 

I suppose you're using the NSDate class.

You can use isEqualToDate to compare two NSDate objects. And also the earlierDate and laterDate to check currentdate is bigger than previous date and smaller than next date.

Luca Matteis
A: 

NSDate objects also implement well-documented -compare: method.

Costique