The easiest method i’m aware is:
if( [firstDate timeIntervalSinceDate:secondDate] > 0 ) {
The other answers cover compare:, wanted to add some flavour ;).
Related Contents:
- How do I add 1 day to an NSDate?
- NSDate get year/month/day
- Convert NSDate to NSString
- Subtract 7 days from current date
- NSPredicate: filtering objects by day of NSDate property
- How can I calculate the difference between two dates?
- iOS: Compare two dates
- How to Check if an NSDate occurs between two other NSDates
- Sort NSArray of date strings or objects
- What unit of time does timeIntervalSinceDate return?
- Converting a string to an NSDate
- Get Current date & time with [NSDate date]
- How can I get an NSDate object for today at midnight?
- How do I get the current date in Cocoa
- Calculating the number of days between two dates in Objective-C
- Getting the last day of a month
- How to add hours to an NSDate?
- @synthesize vs @dynamic, what are the differences?
- “sending ‘const NSString *’ to parameter of type ‘NSString *’ discards qualifiers” warning
- Would it be beneficial to begin using instancetype instead of id?
- What is the Objective-C equivalent for “toString()”, for use with NSLog?
- When should I use nil and NULL in Objective-C?
- When to use enumerateObjectsUsingBlock vs. for
- Capitalize or change case of an NSString in Objective-C
- How do I get the day of the week with Foundation?
- How to increment a NSNumber
- Advantages, problems, examples of adding another UIWindow to an iOS app?
- Getting row of UITableView cell on button press
- Compiler error: “initializer element is not a compile-time constant”
- Case in protected switch [duplicate]
- Xcode6: IBDesignable and IBInspectable with Objective-C
- UIPopoverPresentationController on iOS 8 iPhone
- Comparing two NSDates and ignoring the time component
- What is autoreleasepool? [duplicate]
- Convert Seconds Integer To HH:MM, iPhone
- Comparing NSNumbers in Objective C
- Is there a constant for the maximum CGFloat value?
- Adding a custom subview (created in a xib) to a view controller’s view – What am I doing wrong
- Circular Progress Bars in IOS
- CFURLCopyResourcePropertyForKey failed because passed URL no scheme
- Simple http post example in Objective-C?
- UITableViewCell checkmark change on select
- Why are umbrella frameworks discouraged? [closed]
- Dependency injection framework for Cocoa? [closed]
- NSManagedObjectContext: exception breakpoint stops at save: method, but no log/crash/error
- AFNetworking 2.0 AFHTTPSessionManager: how to get status code and response JSON in failure block?
- Property vs Instance Variable [duplicate]
- How to get localized Cancel, Done and etc?
- UITapGestureRecognizer selector, sender is the gesture, not the ui object
- Xcode: Possible to auto-create stubs for methods required by Protocol interface?