I\'m trying to make a high score table, and suck at arrays in objective c (actually, in general objective c is challenging for me), so I can\'t figure out how to sort. I\'m
distance is a key and it's value link (float or double)
NSSortDescriptor *sortDescriptor = [NSSortDescriptor sortDescriptorWithKey:@"distance"
ascending:YES
comparator:^(id obj1, id obj2)
{
return [obj1 compare:obj2 options:NSNumericSearch];
}];
NSArray *myArray = [NSArray arrayWithArray:arraySubCat];
myArray=[myArray sortedArrayUsingDescriptors:[NSArray arrayWithObjects:sortDescriptor,nil]];
arraySubCat = [myArray copy];