In my NSArray, I have two types of objects, let’s say objects of class A and class B.
I want to sort these objects, by comparing “startingDate” property of class A to “endingDate” property of class B. And I don’t know how to make a comparison based on two different properties of different classes.
What’s the best way to do this?
Blocks are what you want, take a look at this question:
How to sort an NSMutableArray with custom objects in it?
In the blocks example on that question, just have class A use startingDate and class B use ending date.