How can I sort strings in NSMutableArray into alphabetical order?

There is the following Apple’s working example, using sortedArrayUsingSelector: and localizedCaseInsensitiveCompare: in the Collections Documentation:

sortedArray = [anArray sortedArrayUsingSelector:
                       @selector(localizedCaseInsensitiveCompare:)];

Note that this will return a new sorted array. If you want to sort your NSMutableArray in place, then use sortUsingSelector: instead, like so:

[mutableArray sortUsingSelector:@selector(localizedCaseInsensitiveCompare:)];

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)