Skip navigation.
 
mlHow do I obtain the default country?
FROM : BK [address used for mailing lists only]
DATE : Sun Dec 26 03:13:10 2004

I have a popup menu with a choice of 200 something countries. The menu
should be presented to a user such that the country he is in will be
preselected already as the default.

So far I have been poking around in
/Library/Preferences/.GlobalPreferences.plist and picked some of the
fields that seem to contain IANA codes for countries and country names.
This works but since there are no tags that describe exactly what those
values are used for by OSX, I consider this a quick and dirty interim
hack which is bound to break at some point or in certain situations.

I would rather like to use a proper API call which tells me what the
current locale is set to. Also, this is for a system level tool, and
NOT a user level tool, so I would like to make sure I pick up a system
wide setting and not accidentally a user preference.

What is considered best practise in Cocoa to obtain such system level
information and are there any examples?

thanks
rgds
bk

Related mailsAuthorDate
No related mails found.