I have an NSArray containing 6x 3D arrays with image pixel data, and an NSMutableArray with 6 values. I would like to sort the NSMutableArray array numerically and sort the NSArray in the same order that the NSMutableArray is sorted. I know how to do this in python but I am not great with Objective-C
i.e.,: from: NSArray = [img1, img2, img3] NSMutableArray = [5, 1, 9] to: NSArray = [img2, img1, img3] NSMutableArray = [1, 5, 9]
NSArray *imageArray = [...some images];
NSMutableArray *valueList = [[NSMutableArray alloc] initWithCapacity:0];
float value1 = 5.0;
float value2 = 1.0;
float value3 = 9.0;
[valueList addObject:[NSDecimalNumber numberWithFloat:value1]];
[valueList addObject:[NSDecimalNumber numberWithFloat:value2]];
[valueList addObject:[NSDecimalNumber numberWithFloat:value3]];