Contents

조회 수 269596 댓글 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++] WinSock2.0 채팅 프로그램 ㅋㅋ file hooni 2013.04.23 8521
284 Develop [c] 무선 Radius Server 자료.. file hooni 2013.04.23 7260
283 Develop [c++] MD5 구현 소스.. 퍼움.. file hooni 2013.04.23 24070
282 Develop [c] 콘솔에서 패스워드 입력시 문자 보이지 않게 하는 코드 file hooni 2013.04.23 8326
281 Develop [c] 도스 공격(DoS Attack) 프로그램 file hooni 2013.04.23 11575
280 Develop [php] 웹 터미널 & 업로드 소스.. file hooni 2013.04.23 7218
279 Develop [c] 간단한 점 이동 샘플 소스코드 hooni 2013.04.23 6541
278 System/OS 해커스랩 깨기.. 후후.. ㅋㅋ file hooni 2013.04.23 18413
277 Develop [php] 웹 응용프로그램(engines) 모음 file hooni 2013.04.23 7515
276 Develop [js] One Time Pad key generatorㅡ.,ㅡ; file hooni 2013.04.23 6789
275 Algorithm 암호 알고리즘 및 프로토콜의 이해.. file hooni 2013.04.23 17208
274 System/OS [linux] /etc/fstab 설정 방법.. ㅋㅋ hooni 2013.04.23 12081
Board Pagination Prev 1 ... 70 71 72 73 74 75 76 77 78 79 ... 98 Next
/ 98