Return to Snippet

Revision: 14217
at May 25, 2009 02:23 by arpit


Updated Code
NSArray* allResteraunts = [[NSArray alloc] initWithObjects:@"Peiking", @"AHotel", @"BHotel", nil];
NSSortDescriptor *desc = [[NSSortDescriptor alloc] initWithKey:nil ascending:YES selector:@selector(localizedCompare:)]; 
NSArray *sortedArray = [allResteraunts sortedArrayUsingDescriptors:[NSArray arrayWithObject:desc]];
[desc release];

Revision: 14216
at May 25, 2009 02:22 by arpit


Initial Code
NSArray* allResteraunts = [[NSArray alloc] initWithObjects:@"Peiking", @"AHotel", @"BHotel", nil];
NSSortDescriptor *desc = [[NSSortDescriptor alloc] initWithKey:nil ascending:YES selector:@selector(localizedCompare:)]; 
		NSArray *sortedArray = [allResteraunts sortedArrayUsingDescriptors:[NSArray arrayWithObject:desc]];
[desc release];

Initial URL
http://www.mail-archive.com/[email protected]/msg09385.html

Initial Description

                                

Initial Title
Sorting an NSArray with raw NSString objects

Initial Tags
iphone

Initial Language
Objective C