We Recommend

Programming in Objective-C Programming in Objective-C
Programming in Objective-C is a concise, carefully written tutorial on the basics of Objective-C and object-oriented programming. The book makes no assumption about prior experience with object-oriented programming languages or with the C language (upon which Objective-C is based). And because of this, both novice and experienced programmers alike can use this book to quickly and effectively learn the fundamentals of Objective-C.


Posted By

jonathanbp on 06/19/08


Tagged

sort array objc IBM


Versions (?)


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.