티스토리 뷰
+ (NSString*) getCountryCode
{
NSLocale *currentLocale = [NSLocale currentLocale];
NSString *countryCode = [currentLocale objectForKey:NSLocaleCountryCode];
return countryCode;
}
// output : KR
+ (NSString*) getCountryName
{
NSLocale *locale = [NSLocale currentLocale];
NSString *countryCode = [locale objectForKey: NSLocaleCountryCode];
NSLocale *usLocale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US"];
NSString *country = [usLocale displayNameForKey: NSLocaleCountryCode value: countryCode];
return country;
}
// output : South Korea
출처
https://stackoverflow.com/questions/6177309/nslocale-and-country-name/6177819
2020/08/13 - [Development Note/Android] - [Android Java] 국가코드 및 국가명 가져오기
'Development Note > iOS' 카테고리의 다른 글
[objective-c] 인앱결제시 실패메시지 (0) | 2020.08.26 |
---|---|
[objective-c] 절대값 구하기 (0) | 2020.08.14 |
[objective-c] 언어코드 가져오기 (0) | 2020.08.13 |
[objective-c] DeviceID 가져오기 (0) | 2020.08.13 |
[objective-c] DeviceName 가져오기 (0) | 2020.08.13 |
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- DeviceModel
- permissionCheck
- java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line
- ioutil
- nsurl 에서 nsstring 변환
- 퍼미션체크
- setCancelable vs setCanceledOnTouchOutside
- dialog
- tempfile
- 절대값함수
- NSUserDefaults 예제
- Error Domain=SKErrorDomain Code=0
- countryName
- abs
- Locale.getDefault().getLanguage()
- convert nsurl to nsstring
- abs 함수
- LanguageCode
- tempdir
- nsurl to nsstring convert
- countryCode
- iTunes Store에 연결할 수 없음
- Golang
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
글 보관함