I have a sectioned UITableView with 3 categories. I'm using this code:
NSArray *arrayOne = [NSArray arrayWithObjects: @"one", @"two", "three", "four", nil];
NSDictionary *dictOne = [NSDictionary dictionaryWithObject:arrayOne forKey:@"Elements"];
for each category.
How can i sort them alphabetically? I've read some answers here but i didn't found out anything.
If i use the code in this answer Method for sorting custom objects alphabetically in UITableView it doesn't work. i have the code:
[listObjects addObject:dictOne];
and if i put
[listOfTitles sortUsingDescriptors:[NSArray arrayWithObject:titleSorter];
It doesn't work.
Any help appreciated
NSArray *arrayOne = [NSArray arrayWithObjects: @"one", @"two", "three", "four", nil];
NSArray *sortedArray = [arrayOne sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare:)];
NSDictionary *dictOne = [NSDictionary dictionaryWithObject:sortedArray forKey:@"Elements"];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With