Posted By

rabc on 10/30/10


iphone nsmutablearray NSArray

Versions (?)

Who likes this?

2 people have marked this snippet as a favorite


Sort array using NSDecriptor

 / Published in: Objective C

  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  

You need to login to post a comment.