Find locale currency for iphone programmatically

前端 未结 7 511
攒了一身酷
攒了一身酷 2020-12-02 05:20

I want to find out the currency locale on user\'s iphone programmatically. That means, if user is in US Store, the currency locale should be USD, for Australia, it should be

7条回答
  •  生来不讨喜
    2020-12-02 06:00

    I used these keys to extract currency symbols/codes from locales

    NSLocale *theLocale = [NSLocale currentLocale];
    NSString *symbol = [theLocale objectForKey:NSLocaleCurrencySymbol];
    NSString *code = [theLocale objectForKey:NSLocaleCurrencyCode];
    

提交回复
热议问题