Sorting Array Based on custom object values
问题 I Need to Sort out an array of custom objects. The object is simple, it stores an x and y co-ordinate, for example: XYPointObject.xCoordinate = [NSNumber]; XYPointObject.yCoordinate = [NSNumber]; I have an array that stores up to 676 of these objects that I need to sort into a numerical order as in x values in numerical order, and the y values connected to the x values in order as well. for example, if the input co-ordinates are: 23,5 | 5,7 | 1,4 | 1,7 | 21,8 | 9,12 | 16,19 the sorted array