I have 4 values in my NSDictionary below which are 1000,640,80 and 0 It sorts the non-zero values correctly but it always gives 0 as greater than all the other values like (descending): 0,1000,640,80 Here's the code:
NSMutableDictionary *dict = [[self model] stateFromDocumentNamed:@"state"];
NSArray *values=[dict allValues];
NSMutableArray *mutvalues = [(NSArray*)values mutableCopy];
[mutvalues sortUsingSelector:@selector(compare:)];
values=[[values reverseObjectEnumerator] allObjects];
NSLog(@"%@",mutvalues);