Compare two nsdatecomponent

iphone, objective-c

Solution

Use `compare:` on the `NSDate` of the `NSDateComponent`.

if([[nsdatecomponentObject1 date] compare:[nsdatecomponentObject2 date]] == NSOrderedAscending)

Problem

if I have two nsdatecomponent and I want a know if the TIME in the first object is bigger than the second. example: ``` if (nsdatecomponentObject1 > nsdatecomponentObject2) { //something } ``` Because this way don't works, how I can do this?

Original source