Skip to main content
added 29 characters in body
Source Link
Ecarrion
  • 5k
  • 1
  • 36
  • 44

The easiest way I know is using a sortDescriptor:

// Sort the tags by name 
NSSortDescriptor * firstDescriptor = [[[NSSortDescriptor alloc] initWithKey:@"name" ascending:YES selector:@selector(caseInsensitiveCompare:)]

ascending:YES] autorelease];

 
NSArray * descriptors = [NSArray arrayWithObjects:firstDescriptor, nil]; 
NSArray * sortedArray = [tagsArray sortedArrayUsingDescriptors:descriptors];

The easiest way I know is using a sortDescriptor:

// Sort the tags by name 
NSSortDescriptor * firstDescriptor = [[[NSSortDescriptor alloc] initWithKey:@"name"

ascending:YES] autorelease];

NSArray * descriptors = [NSArray arrayWithObjects:firstDescriptor, nil]; 
NSArray * sortedArray = [tagsArray sortedArrayUsingDescriptors:descriptors];

The easiest way I know is using a sortDescriptor:

// Sort the tags by name 
NSSortDescriptor * firstDescriptor = [[[NSSortDescriptor alloc] initWithKey:@"name" ascending:YES selector:@selector(caseInsensitiveCompare:)]
 
NSArray * descriptors = [NSArray arrayWithObjects:firstDescriptor, nil]; 
NSArray * sortedArray = [tagsArray sortedArrayUsingDescriptors:descriptors];
Source Link
Ecarrion
  • 5k
  • 1
  • 36
  • 44

The easiest way I know is using a sortDescriptor:

// Sort the tags by name 
NSSortDescriptor * firstDescriptor = [[[NSSortDescriptor alloc] initWithKey:@"name"

ascending:YES] autorelease];

NSArray * descriptors = [NSArray arrayWithObjects:firstDescriptor, nil]; 
NSArray * sortedArray = [tagsArray sortedArrayUsingDescriptors:descriptors];