views:

62

answers:

1

Hello,

I have to get the current country in the iPhone settings. Can anyone tell me how to get the current country in iPhone application.

I have to use the current country for parsing the RSS feed in which I need to pass the current country.

Please help me out to find the country .

Thanks in advance.

+5  A: 
NSLocale* currentLocale = [NSLocale currentLocale];  // get the current locale.
NSString* countryCode = [currentLocale objectForKey:NSLocaleCountryCode];
// get country code, e.g. ES (Spain), FR (France), etc.
KennyTM
+1 nice i learn something new please tell can i get some more information on this...
Ranjeet Sajwan
@ranjeet: You can find the reference for NSLocale in http://developer.apple.com/library/ios/#documentation/cocoa/reference/foundation/Classes/NSLocale_Class/Reference/Reference.html.
KennyTM
thanks a lot....
Ranjeet Sajwan
Thank you very much. I got the answer.
Tech Guru