On Apr 13, 2011, at 4:30 PM, Motti Shneor wrote:

> Hi.
> 
> In our program, we need to let the user choose a country code from a list, 
> just like you choose input source from the language menu.
> 
> I was wondering whether these well designed and pretty-complete lists of 
> countries regions and their flags and country-codes (phone) are available to 
> the developer via some API, or well-defined image names?
> 
> I tried to play with NSLocale, but could not get any further than a list of 
> countries.
> 
> Any hint will make me very happy!


Hello Motti,

I've written code that enumerates through Text Input Source properties (e.g. 
the CFArray returned by the TISCreateInputSourceList function) and for each 
TISInputSourceRef, comes up with the localized name (kTISPropertyLocalizedName) 
and those pretty flag icons (kTISPropertyIconImageURL). 

That said, I really recommend against doing this.  It sounds like what you're 
doing has nothing to do with input source stuff.  Better to write your own 
custom data structure (e.g. an array of NSDictionary objects) where you have in 
each entry a localized name, country codes and flag icons that you either copy 
/ borrow from the raw TIS files or, even better, use your own flag icons in a 
proper OS X friendly format (Text Input Source icons are "classic" Mac OS 9 
format, IIRC -- I'm using them in my code as an IconRef).  

I hope my opinion helps you out!

michael


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to