Develop
2016.05.13 11:17

[ios] UUID 생성 + Key Chain 연동

조회 수 10177 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

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

단축키

Prev이전 문서

Next다음 문서

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

UUID 쉽게 사용하기 ㅋㅋ


KeychainItemWrapper.h/m 파일은 업로드된 것을 사용해도 되고 아래 URL에 있는 내용을 사용해도 됨.

(어차피 업로드 된 것도 저거 다운 받아서 업로드 한거니.. ㅋㅋ)


# KeychainItemWrapper.h 파일

https://developer.apple.com/library/ios/samplecode/GenericKeychain/Listings/Classes_KeychainItemWrapper_h.html


# KeychainItemWrapper.m 파일

https://developer.apple.com/library/ios/samplecode/GenericKeychain/Listings/Classes_KeychainItemWrapper_m.html


#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;
}


?

  1. [js] 윤동이가 만든 영어 학습(?) 프로그램

  2. [js] 이미지 미리 로딩하기

  3. [js] 이미지 사이즈를 동적으로 조절..

  4. [js] 이벤트 전파 3단계

  5. [js] 이벤트 핸들러(Event Handlers)

  6. [js] 인터넷 주소(URL) 인코딩 ㅋㅋ

  7. [js] 자바스크립트 escape()를 PHP로 받기

  8. [js] 자바스크립트 메뉴얼 사이트.. ㅋㅋ

  9. [js] 자바스크립트 이벤트 핸들..

  10. [js] 자바스크립트(Javascript) 코드를 동적으로 삽입하는 방법..

  11. [js] 자바스크립트로 만든 게임

  12. [js] 자바스크립트로 응용프로그램 실행 ㅎㅎ

  13. [js] 자바스크립트를 동적으로 로딩하기

  14. [js] 자바스크립트와 정규표현식 메뉴얼 (chm 형식)

  15. [js] 자바스크립트의 클로저 (JavaScript's Closure)

  16. [js] 점점 커지는 새창..

Board Pagination Prev 1 ... 45 46 47 48 49 ... 74 Next
/ 74