'Objective-C Sort a array with subarrays with key

Have a NSMutable Array that add subarrays with key, i try sort by "distkm", but not sort:

[alldata addObject:@{@"sublista": sublista, @"subdetail": subdetail, @"distkm": distkm }];
NSSortDescriptor *descriptor = [NSSortDescriptor sortDescriptorWithKey:@"distkm" ascending:YES];
alldata = (NSMutableArray *)[alldata sortedArrayUsingDescriptors:@[descriptor]];

But result is same before sort: Result of sort array

Agree some help. THANKS



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source