[m_array objectAtIndex:m_histCount-1]
and
[m_array objectAtIndex:i+1]
will return an object, and you can't test an object with <. That means these two lines are invalid.
However, in any situation where you'd expect an object, getting them directly from the array would work. This even works:
if([[[m_array objectAtIndex:i+1] date] timeIntervalSinceDate:[m_array objectAtIndex:m_histCount-1] < 0])
That is, it works if those indexes return NSDate objects.
Since arrays could contain any kind of object, it's best to make sure the object you get is of the correct type.
Edit:
It turns out you can compare objects with the < and > operands, but it's not useful. You're comparing their pointer values, which is just a pretty much random id. This does mean your lines are valid, I guess, but not really useful.
Source: How to compare objects using operator < or > in Objective-C?