Posted By

code4mac on 11/01/12


Tagged

NSDate


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

hawk007


Compare 2 NSDate


 / Published in: Objective C
 

Compare 2 NSDate

  1. switch ([dateOne compare:dateTwo]) {
  2. case NSOrderedAscending:
  3. // dateOne < dateTwo
  4. break;
  5. case NSOrderedSame:
  6. // The dates are the same
  7. break;
  8. case NSOrderedDescending:
  9. // dateOne > dateTwo
  10. break;
  11. }

Report this snippet  

You need to login to post a comment.