Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

AbhishekApple

macrumors member
Original poster
Aug 5, 2010
86
0
I want to sort the array with case insensitive,


This code sorts capital letters first n then small letters
Code:
listOfSItems =[[NSMutableArray alloc] initWithObjects:
 [NSDictionary dictionaryWithObjectsAndKeys:@"Abhishek",@"firstName",@"9987544244",@"Phone",nil],
 [NSDictionary dictionaryWithObjectsAndKeys:@"Rohit",@"firstName",@"Phone",nil],
.........
nil];									  
 

	NSSortDescriptor *sort;
	sort=[[[NSSortDescriptor alloc] initWithKey:@"firstName" ascending:YES]autorelease];
	
	NSArray *sortedDesc = [NSArray arrayWithObject:sort];
	[listOfSItems sortUsingDescriptors:sortedDesc];

Please suggest
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.