Search code examples
iphonelocalecurrencysymbols

Generate locale of all currencies in iPhone


I want generate array of all locales for all International currencies. I want to display the array of currency symbols , so user can select any one. To generate the currency symbol i need the locale of all the International currencies. Please any one guide me to generate array of currencies locale.

Thanks.


Solution

    1. Get an array of all available locale identifiers with [NSLocale availableLocaleIdentifiers];
    2. Loop over the array and create an NSLocale instance for each locale id.
    3. Get the locale's currency symbol with [locale objectForKey:NSLocaleCurrencySymbol];.
    4. Insert the currency symbols into the data structure (array, dictionary) you need for further processing.