You can sort NSArray :
/* Sort array */
- (NSArray*) sortArray:(NSArray*) dArray ascending:(BOOL)bl {
/* Sort data */
NSSortDescriptor *sortDescriptor;
sortDescriptor = [[[NSSortDescriptor alloc] initWithKey:@""
ascending:bl] autorelease];
NSArray *sortDescriptors = [NSArray arrayWithObject:sortDescriptor];
NSArray *sortedArray;
sortedArray = [dArray sortedArrayUsingDescriptors:sortDescriptors];
return sortedArray;
}
No comments:
Post a Comment