NSLocale sorting data

Discussion in 'iOS Programming' started by shtuceron, Dec 11, 2011.

  1. shtuceron macrumors newbie

    Joined:
    Dec 22, 2009
    #1
    Hello

    I am trying to get locale code ordering by name (alphabet sorting). I use construction of this:

    Code:
    NSArray *availableLocaleIdentifiers = [NSLocale preferredLanguages];
        
    for (int i = 0; i < [availableLocaleIdentifiers count]; i++)
    {
        NSLog(@"%@\n", [availableLocaleIdentifiers objectAtIndex:i]);
    }
    
    and I have this result:

    en
    ja
    de
    fr
    nl
    it
    es
    ...

    How can I get this result but sorted in alphabet order?

    Thanks.
     

Share This Page