Skip to content

Instantly share code, notes, and snippets.

@bouchtaoui-dev
Created September 22, 2017 09:44
Show Gist options
  • Select an option

  • Save bouchtaoui-dev/2f3782ffc0a4a8ae9156831fa37e37dd to your computer and use it in GitHub Desktop.

Select an option

Save bouchtaoui-dev/2f3782ffc0a4a8ae9156831fa37e37dd to your computer and use it in GitHub Desktop.
Ordering NSMutableArray by NSNumber
// source: https://stackoverflow.com/a/3207959/1012775
NSSortDescriptor *highestToLowest = [NSSortDescriptor sortDescriptorWithKey:@"self" ascending:NO];
[mutableArrayOfNumbers sortUsingDescriptors:[NSArray arrayWithObject:highestToLowest]];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment