nslocale - How to convert two letter currency code to base locale identifier on IOS -


i need convert 2 letter country code, default, native, identifier, e.g. tw > zh_tw not en_tw. > en_us. ru > ru_ru, not en_ru. isn't justg same 2 letters repeated. note, need country code, not language code. there simple way, using nslocale, or have have big list !?

thanks

shaun southern

nsstring *countrycode = @"ie";  nsdictionary *components = [nsdictionary dictionarywithobject:countrycode forkey:nslocalecountrycode];  id localeident = [nslocale localeidentifierfromcomponents:components];                         nslocale *locale = [[nslocale alloc] initwithlocaleidentifier:localeident]; 

Comments

Popular posts from this blog

android - How to save instance state of selected radiobutton on menu -

python 3 IndexError: list index out of range -

IF statement in MySQL trigger -