본문 바로가기

□컴퓨터 관련/★iPhone Developer

IPHONE 에서 국가 설정 값 및 언어 설정 값 가져 오는 법.


NSLocale *locale = [NSLocale currentLocale];
NSString* conCode = [locale objectForKey:NSLocaleCountryCode];
NSString* conName = [locale displayNameForKey:NSLocaleCountryCode value:conCode];

국가 리전 코드 값은
http://lifehack.kr/90095666575

참고 하시면 됩니다.!!!! 뒤에 큰 대문자들입니다 ^^

========================================== 언어 설정 값 =====================================

NSUserDefaults* defs = [NSUserDefaults standardUserDefaults];
NSArray* languages = [defs objectForKey:@"AppleLanguages"];
NSString* currentLanguage = [languages objectAtIndex:0];

입니다 ^^

예를 들자면..

if([currentLanguage usEqualToString:@"ko"])
{
     ******
}
else
{
   ********
}

출처 : http://gods2000.tistory.com/