Created
August 22, 2013 16:52
-
-
Save peterlee0127/6309860 to your computer and use it in GitHub Desktop.
sorting
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[modelsArray sortUsingSelector:@selector(myCompareMethodWithDict:)]; | |
@interface GeofenceDataModel(myCompare) | |
- (NSComparisonResult)myCompareMethodWithDict: (GeofenceDataModel *) model; | |
@end | |
@implementation GeofenceDataModel (myCompare) | |
- (NSComparisonResult)myCompareMethodWithDict: (GeofenceDataModel *) model | |
{ | |
NSNumber *place1 = [[NSNumber alloc] initWithFloat:self.distance]; | |
NSNumber *place2=[[NSNumber alloc] initWithFloat:model.distance]; | |
return [place1 compare: place2]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment