I am trying to sort an array by the highest number that I assigned to each entry in the array.
However i don't think it's doing anything. Any suggestions on where the error may be?
Thanks!
- (NSArray*)sortByPercentage:(NSArray*)array {
NSArray *inputArray = array;
NSSortDescriptor *sortDescriptor = [[ NSSortDescriptor alloc] initWithKey:@"percentMatched" ascending:YES];
//nov 8
NSArray *sortDescriptors = [NSArray arrayWithObject:sortDescriptor];
NSArray *finalResult = [inputArray sortedArrayUsingDescriptors:sortDescriptors];
[sortDescriptor release];
return [NSArray arrayWithArray:finalResult];
}