Develop
2016.05.13 11:17
[ios] UUID 생성 + Key Chain 연동
조회 수 10191 댓글 0
첨부 '2' |
---|
UUID 쉽게 사용하기 ㅋㅋ
KeychainItemWrapper.h/m 파일은 업로드된 것을 사용해도 되고 아래 URL에 있는 내용을 사용해도 됨.
(어차피 업로드 된 것도 저거 다운 받아서 업로드 한거니.. ㅋㅋ)
# KeychainItemWrapper.h 파일
# KeychainItemWrapper.m 파일
#import "KeychainItemWrapper.h" - (NSString *)getDeviceUUID { KeychainItemWrapper *keychainItemWrapper = [[KeychainItemWrapper alloc] initWithIdentifier:@"UUID-Identifier" accessGroup:nil]; NSString *uuidString = [keychainItemWrapper objectForKey:(__bridge id)(kSecAttrAccount)]; if (uuidString == nil || [uuidString length] == 0) { // if there is not UUID in keychain, make UUID and save it. CFUUIDRef uuidRef = CFUUIDCreate(NULL); CFStringRef uuidStringRef = CFUUIDCreateString(NULL, uuidRef); CFRelease(uuidRef); uuidString = [NSString stringWithString:(__bridge NSString *)uuidStringRef]; CFRelease(uuidStringRef); // save UUID in keychain [keychainItemWrapper setObject:uuidString forKey:(__bridge id)(kSecAttrAccount)]; } return uuidString; }
TAG •
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
625 | Develop | [c] OpenGL 직사각형(2D) 크기 확대/축소 | hooni | 2003.04.23 | 10088 |
624 | Develop |
[c][java] 주사선 채우기 알고리즘(scan line filling algorithm) 구현
![]() |
hooni | 2013.04.23 | 10038 |
623 | Develop |
[c][cpp] mfc, win32api, 예제 소스 대박 모음~
![]() |
hooni | 2013.04.23 | 10026 |
622 | Develop | [c] OpenGL 마우스 이벤트 | hooni | 2003.04.23 | 10023 |
621 | Develop |
[java] 채팅창 처럼.. swing..
![]() |
hooni | 2013.04.23 | 9998 |
620 | Develop |
[c] 컴파일러 DFA구현^^ 입력 받아 실행
4 ![]() |
hooni | 2003.04.23 | 9977 |
619 | System/OS | [linux] man 명령어 뽀개기.. | hooni | 2003.04.23 | 9956 |
618 | Develop | [c] Unix Domain Socket 을 이용한 IPC | hooni | 2013.04.23 | 9953 |
617 | System/OS | [linux] 간단한 find 명령어 설명(업데이트 해야 함) | hooni | 2013.04.23 | 9945 |
616 | Develop |
[c++] 중복실행 방지(Mutex;뮤텍스 ) 샘플 소스.. ㅋㅋ
![]() |
hooni | 2013.04.23 | 9929 |
615 | Develop | [c] 이진트리(binary tree)의 운행.. | hooni | 2003.04.23 | 9929 |
614 | Develop |
[c++] mfc 윈도우에서 ODBC 사용하여 MDB파일 읽기.. ㅋㅋ
![]() |
hooni | 2013.04.23 | 9920 |