Sort array using NSDecriptor

/ Published in: Objective C
Save to your folder(s)

Copy this code and paste it in your HTML
  1. NSSortDescriptor *sortDescriptor = [[[NSSortDescriptor alloc] initWithKey:@"sort_value" ascending:YES] autorelease];
  2. NSArray *sortDescriptors = [NSArray arrayWithObject:sortDescriptor];
  3. array = [NSMutableArray arrayWithArray:[array sortedArrayUsingDescriptors:sortDescriptors]];

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.