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

mikezang

macrumors 6502a
Original poster
May 22, 2010
939
41
Tokyo, Japan
I have a array with string with letters , I hope they can sorted as below, what can I do? I read NSArray about sort methods, but I am not sure how to do in detail, can you help me?

A < ā < á < ǎ < à < B... < D < E < ē < é < ě < è < F .. < I < ī < í < ǐ < ì < J .. < N < O < ō < ó < ǒ < ò < P ... < T < U < ū < ú < ǔ < ù < ǖ < ǘ < ǚ < ǜ < V ... < Z
 
Obviously the above is just an example, but the Finnish alphabet is ordered as follows: a,b,c,..,x,y,z,å,ä,ö.

Apple's developer documentation is pretty good, see: Searching, Comparing, and Sorting Strings
Thanks for your link, I had read it, but it seems like very complex, I hope if I can find a simple and direct code...
Anyway, I will try to find it by myself and wait for a expert give me suggestion.
 
Thanks for your link, I had read it, but it seems like very complex, I hope if I can find a simple and direct code...
Anyway, I will try to find it by myself and wait for a expert give me suggestion.

An Objective-C tutorial would probably be in order.
Code:
NSArray *sortedArray =
    [myArray sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)];
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.