• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Country code or name
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Country code or name


  • Subject: Re: Country code or name
  • From: Terry Simons <email@hidden>
  • Date: Sun, 14 Sep 2003 19:54:41 -0600

What about a mixture of the two?

Grab their Country information out of the address book and ask the user if the information is valid. That way, if the information is valid, the user doesn't have to do as much work.

Just a thought. :)

- Terry

On Sep 12, 2003, at 4:41 PM, Dave Rosborough wrote:

I agree with the suggestion to ask them. But another, perhaps better method, would be to look in the Address Book database for the country of the owner. Since it's information that is requested when you install the OS or set up your new computer, MOST people should have the country specified for their own record.

That being said, that's making a pretty big assumption. Probably safest just to ask when the program starts for the first time.

TTYL
DaveR

On Friday, September 12, 2003, at 03:06 PM, Tom Harrington wrote:

On Friday, September 12, 2003, at 09:44 AM, Simon Stapleton wrote:
Well, I've been loking all over the place, but I can't seem to find it. I need to be able to at least guess the current user's country (not timezone, that's not specific enough, or language, that doesn't work either). I'd like to avoid having to code this all up myself, but can do if needs be.

The best I can do at the moment is to query NSTimeZone for the current time zone setting and make a guess from there (as a part of initial app setup, to provide a reasonable default) and then set a preference in the app's domain. But it seems to me that there should be a better way.

If the user has set the time zone using System Preferences, the "closest city" should be a pretty good indicator. For example, if a user clicks in western Europe, and then chooses Paris as the closest city, the local time zone name is going to be "Europe/Paris", even though other cities are actually in the same time zone (e.g. if they chose Zurich, they'd be in the same time zone, but the zone name would be "Europe/Zurich"). You'd have create some kind of lookup to turn that into a country, but ultimately it's going to be more specific than you suggest. Look in /usr/share/zoneinfo for defined zone names, or just in System Preferences for what users get to choose from.

Barring a policy of requiring users to have USB-attached GPS units, you're going to be relying on the user to specify the information somewhere, directly or otherwise. Maybe it'd be best to just ask > them.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Country code or name (From: Dave Rosborough <email@hidden>)

  • Prev by Date: Re: Country code or name
  • Next by Date: Re: Turning OFF indexing of Java projects
  • Previous by thread: Re: Country code or name
  • Next by thread: Re: Country code or name
  • Index(es):
    • Date
    • Thread