sorter = [[NSSortDescriptor alloc] initWithKey:@"name" ascending:YES selector:@selector(caseInsensitiveCompare:)];
Friday, December 31, 2010
Case-insensitive NSSortDescriptor usage
I found this little gem today which was quite useful! If you are using a NSSortDescriptor to sort data using strings, you can make it case insensitive with the following:
Labels:
NSSortDescriptor,
NSString
Subscribe to:
Post Comments (Atom)
Thanks man!!!
ReplyDeleteThank you! This is exactly what I'm looking for
ReplyDeleteThanks for sharing tiny code of sorting method. I would like to if it works fine with Mobile Apps Development having huge data.
ReplyDelete