[Solved] Sorting in Objective C [duplicate]

[ad_1]

For a full explanation see this answer from a related question.


In short you basically have to implement…

- (NSComparisonResult)compare:(Contact *)otherContact;

…in your Contact class (order of comparison: self, otherContact).

NSComparisonResult has three possible values: NSOrderedAscending, NSOrderedSame and NSOrderedDescending.

[ad_2]

solved Sorting in Objective C [duplicate]