You might want to define locale..
and there is too much autoreleased memory, which might be critical, ye never know. so create autoreleased pool inside the for loop as well.
I've this:
NSMutableArray * countriesArray = [[NSMutableArray alloc] init];
NSLocale *locale = [[[NSLocale alloc] initWithLocaleIdentifier: @"en_US"] autorelease];
NSArray *countryArray = [NSLocale ISOCountryCodes];
for (NSString *countryCode in countryArray)
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSString *displayNameString = [locale displayNameForKey:NSLocaleCountryCode value:countryCode];
[countriesArray addObject:displayNameString];
[countriesDict setObject:countryCode forKey: displayNameString];
[pool release];
}
[countriesArray sortUsingSelector:@selector(compare:)];