wagashi
wagashi

Reputation: 894

Objective-C sort alphabetically nsarray with localized Japanese?

Is the name of localized "jp" or "jap"

in

[[NSUserDefaults standardUserDefaults] setObject:[NSArray arrayWithObject:@"jp or jap"] forKey:@"AppleLanguages"];

Upvotes: 0

Views: 798

Answers (2)

Ilanchezhian
Ilanchezhian

Reputation: 17478

You can sort your array as following

NSArray *sortedArray = [yourArray sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare:)];

localizedCaseInsensitiveCompare is method in NSString.

Upvotes: 2

iCoder4777
iCoder4777

Reputation: 1692

try with this,

[[NSUserDefaults standardUserDefaults] setObject:[NSArray arrayWithObject:@"ja_JP"] forKey:@"AppleLanguages"];

Upvotes: 1

Related Questions