Develop
2016.05.13 11:17
[ios] UUID 생성 + Key Chain 연동
Views 10177 Comment 0
Attachment '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 •
No. | Category | Subject | Author | Date | Views |
---|---|---|---|---|---|
291 | Develop |
[iphone] 파일 업로드 샘플 코드 ㅎㅎ
![]() |
hooni | 2013.04.23 | 11120 |
290 | Develop | [js] JSON 컨트롤.. 재귀호출로 값 출력하기 | hooni | 2013.04.23 | 29487 |
289 | Develop | [js] 모바일웹에서 이미지 저장하는거 (context menu) 막기 | hooni | 2013.04.23 | 27254 |
288 | Develop | [android] keytool을 사용하여 키스토어 생성 | hooni | 2013.04.23 | 70410 |
287 | Develop | [js]모바일 웹에서 orientationchange | hooni | 2013.04.23 | 20852 |
286 | Develop | 서기의 PHP 동영상 강의(싱싱해) | hooni | 2013.05.15 | 31891 |
285 | Develop | [js] 자바스크립트의 클로저 (JavaScript's Closure) | hooni | 2013.05.15 | 13670 |
284 | Develop |
[Android] 2010년에 만들었던 세미나 자료.
![]() |
hooni | 2013.05.28 | 65398 |
283 | Develop |
[iphone] PerfectlyClear 보정솔루션 최신..
![]() |
hooni | 2013.05.28 | 0 |
282 | Develop |
[ios] IB 없이 개발하기 (html)
![]() |
hooni | 2013.05.31 | 0 |
281 | Develop |
[ios] 스터디 자료 (from 종길M)
![]() |
hooni | 2013.06.04 | 0 |
280 | Develop |
[ios] 패스(path) 앱 메뉴 스타일
![]() |
hooni | 2013.06.11 | 0 |