Posted By

jonathanbp on 06/19/08


Tagged

sort array objc IBM


Versions (?)

Who likes this?

7 people have marked this snippet as a favorite

enajenkins
avanadra
rabc
shimdh
nsbuckner
wpellis
cnathan


array sorting


 / Published in: Objective C
 

  1. // sorting the list by comparing the "date" property on the objects in the array
  2. NSSortDescriptor *dateSortDescriptor = [[[NSSortDescriptor alloc] initWithKey:@"date" ascending:NO selector:@selector(compare:)] autorelease];
  3. [list sortUsingDescriptors:[NSArray arrayWithObjects:dateSortDescriptor, nil]];

Report this snippet  

You need to login to post a comment.