Contents

조회 수 270122 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
아이폰에 설정된 지역 포맷(언어와 국가 정보)를 가져오려면 NSLocale 클래스를 사용한다.

지역 포맷 가져오기
NSLocale *currentLocale = [NSLocale currentLocale];

언어 설정 보기
NSLocale *currentLocale = [NSLocale currentLocale];
NSString *languageCode = [currentLocale objectForKey:NSLocaleLanguageCode];
// ko (en ...)

국가 설정 보기
NSLocale *currentLocale = [NSLocale currentLocale];
NSString *countryCode = [currentLocale objectForKey:NSLocaleCountryCode];
// KR (US ...)

언어와 국가 한번에 가져오기 (locale identifier)
NSLocale *currentLocale = [NSLocale currentLocale];
NSString *lcid = [currentLocale localeIdentifier];
// ko_KR (en_US ...)

아이폰에 설정된 언어(지역 포맷 아님)를 가져오려면 다음과 같이 할 수 있다.
NSString *preferredLanguageCode =
    [[NSLocale preferredLanguages] objectAtIndex:0];
// ko (en ...)

또는 NSUserDefaults 클래스를 사용할 수도 있다.
NSUserDefaults *userDefaults = [standardUserDefaults];
NSArray *languages = [userDefaults objectForKey: @"AppleLanguages"];
NSString *preferredLanguageCode = [languages objectAtIndex:0];
// ko (en ...)


?

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
285 Develop [c] 다중연결 서버 만들기 #2 - select() 사용 file hooni 2013.04.23 9363
284 Develop [c] 다중연결 서버 만들기 #1 - fork() 사용 file hooni 2013.04.23 12922
283 Develop [c] 농구팀 점수 산출 프로그램 소스 file hooni 2003.04.23 7386
282 Develop [c] 네트워크 트래릭 모니터링.. 졸업작품.. 2 file hooni 2013.04.23 11051
281 Develop [c] 네트워크 정보 알아보기 file hooni 2013.04.23 16124
280 Develop [c] 네트워크 보안 프로그래밍 과제 (Server,Agent,Client) file hooni 2013.04.23 6473
279 Develop [c] 네트워크 관련 프로그래밍 (포트스캔 탐지 샘플) file hooni 2013.04.23 7200
278 Develop [c] 내가 만든 암호화 프로그램.. 좋아^^ file hooni 2013.04.23 7022
277 Develop [c] 날짜로 요일 찾기.. hooni 2003.04.23 8484
276 Develop [c] 기본 자료형(int)이 표현할 수 없는 큰 수(Big number)를 덧셈하는 코드. 1 hooni 2013.04.23 13458
275 Develop [c] 기막힌 정렬 코드 ㅋㄷ file hooni 2015.10.13 817
274 Develop [c] 근의 공식으로 2차방정식 풀기.. file hooni 2003.04.23 7778
Board Pagination Prev 1 ... 70 71 72 73 74 75 76 77 78 79 ... 98 Next
/ 98