Develop
2016.05.13 11:17
[ios] UUID 생성 + Key Chain 연동
조회 수 4670 댓글 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 •
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
289 | Develop | [iphone] 파일 업로드 샘플 코드 ㅎㅎ | hooni | 2013.04.23 | 11120 |
288 | Develop | [js] JSON 컨트롤.. 재귀호출로 값 출력하기 | hooni | 2013.04.23 | 28640 |
287 | Develop | [js] 모바일웹에서 이미지 저장하는거 (context menu) 막기 | hooni | 2013.04.23 | 26370 |
286 | Develop | [android] keytool을 사용하여 키스토어 생성 | hooni | 2013.04.23 | 69515 |
285 | Develop | [js]모바일 웹에서 orientationchange | hooni | 2013.04.23 | 19360 |
284 | Develop | 서기의 PHP 동영상 강의(싱싱해) | hooni | 2013.05.15 | 30982 |
283 | Develop | [js] 자바스크립트의 클로저 (JavaScript's Closure) | hooni | 2013.05.15 | 12979 |
282 | Develop | [Android] 2010년에 만들었던 세미나 자료. | hooni | 2013.05.28 | 64663 |
281 | Develop | [iphone] PerfectlyClear 보정솔루션 최신.. | hooni | 2013.05.28 | 0 |
280 | Develop | [ios] IB 없이 개발하기 (html) | hooni | 2013.05.31 | 0 |
279 | Develop | [ios] 스터디 자료 (from 종길M) | hooni | 2013.06.04 | 0 |
278 | Develop | [ios] 패스(path) 앱 메뉴 스타일 | hooni | 2013.06.11 | 0 |