Develop
2016.05.13 11:17

[ios] UUID 생성 + Key Chain 연동

Views 4663 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. [ppt] iOS 플라랩#02(2015.03.19) 발표 자료

    Date2015.04.24 CategoryPPT Byhooni Views898
    Read More
  2. WM미통기 - 10. 조건부확률

    Date2015.04.20 CategoryEtc Byhooni Views705
    Read More
  3. 수리통계학 : 표본공간과 사상-1

    Date2015.04.20 CategoryEtc Byhooni Views900
    Read More
  4. EBS [수학영역] 미적분과 통계 기본 - 정규분포의 의미와 특징은?

    Date2015.04.20 CategoryEtc Byhooni Views1001
    Read More
  5. [js] e.stopPropagation() VS e.preventDefault ()

    Date2015.04.14 CategoryDevelop Byhooni Views808
    Read More
  6. [js] 모바일 스크롤 방지(해제)

    Date2015.04.14 CategoryDevelop Byhooni Views1588
    Read More
  7. [js] 스크롤 이벤트 막기

    Date2015.04.14 CategoryDevelop Byhooni Views1007
    Read More
  8. [ios] 앱에서 설정화면 호출하기

    Date2015.04.07 CategoryDevelop Byhooni Views745
    Read More
  9. [ios] GMT Date와 Local Date 변환하기

    Date2015.04.07 CategoryDevelop Byhooni Views829
    Read More
  10. 아이폰의 터치스크린 정확도

    Date2015.04.01 CategoryEtc Byhooni Views1415
    Read More
  11. [ios] 아이폰 앱 이름 및 버전 정보

    Date2015.03.24 CategoryDevelop Byhooni Views851
    Read More
  12. [ios] 카메라 사용 권한 확인해서 분기하는 방법

    Date2015.02.26 CategoryDevelop Byhooni Views1871
    Read More
  13. [ppt] iOS 플라랩#01(2015.02.26) 발표 자료

    Date2015.02.25 CategoryPPT Byhooni Views731
    Read More
  14. [ios] Touch ID 적용 샘플 코드 (예제)

    Date2015.02.23 CategoryDevelop Byhooni Views668
    Read More
  15. [펌] 게임 엔진 만든거 공개합니다.

    Date2015.02.21 CategoryDevelop Byhooni Views2354
    Read More
  16. [ios] StoryBoard(xib) 없이 프로젝트 만들기

    Date2015.02.12 CategoryDevelop Byhooni Views1067
    Read More
Board Pagination Prev 1 ... 12 13 14 15 16 ... 74 Next
/ 74