Develop
2016.05.13 11:17

[ios] UUID 생성 + Key Chain 연동

Views 4659 Votes 0 Comment 0
Atachment
Attachment '2'
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print

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. [c] 압축 알고리즘 소스 및 정리

  2. [c] 암호화 알고리즘 DES 구현 ㅋㅋ

  3. [c] 암호 알고리즘 소스..

  4. [c] 아파치 모듈(Apache Module) 만들기

  5. [c] 쓰레드에 대한 내용 퍼오기..ㅡㅡ;

  6. [c] 싱글, 더블 링크리스트(linked list)로 만든 예제..

  7. [c] 심심해서.. fseek() 예제..

  8. [c] 신기한 atoi함수(www.game79.net)

  9. [c] 시어핀스키 가스킷..(p.582, A.2 - 두번째)

  10. [c] 시스템공학 레포트 (pass1, pass2)

  11. [c] 시스템 보안 과제.. 시간(amc time) 변경

  12. [c] 시간(요일,날짜 포함) 출력하는 프로그램 초간단 코드

  13. [c] 시간 관련 함수 설명과 예제..

  14. [c] 시간 계산 하는 프로그램 소스코드

  15. [c] 스토리지 클래스(변수)

  16. [c] 스택/힙 오버플로우 테스트(overflow)

Board Pagination Prev 1 ... 50 51 52 53 54 ... 74 Next
/ 74