There are others who have experienced this issue, when NSLocale
is the "system locale". You need to be more defensive in your coding, by either not populating the key if it's nil
or using [NSNull null]
:
NSLocale *locale = [NSLocale currentLocale];
NSString *country = [locale objectForKey:NSLocaleCountryCode];
if (country != nil)
{
[client setObject:country forKey:@"country"];
}