외규장각 도서 환수 모금 캠페인

#define Appdelegate ((AppDelegate *)[[UIApplication sharedApplication] delegate])

Posted by 닉네임영역
,

 //iCloud 막을 Document경로 설정

    NSString *documentPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMaskYESlastObject];

    NSURL *pathURL= [NSURL fileURLWithPath:documentPath];

    

    NSLog(@"%@",documentPath);

    

    if([[[UIDevice currentDevicesystemVersionfloatValue] > 5.0f){

        [self addSkipBackupAttributeToItemAtURL:pathURL];

    }else{

        NSLog(@"CANNOT - CUZ VERSION IS UNDER 5.0.1");

    }



//밑으로 애플에서 알려준 코드 URL에 경로
그래서 위에서 5.0.1버전 부터 호출 하도록하고
경로를 설정.

//Cloud Data 백업 방지...

- (BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)URL

{

    const char* filePath = [[URL pathfileSystemRepresentation];

    

    const char* attrName = "com.apple.MobileBackup";

    u_int8_t attrValue = 1;

    

    int result = setxattr(filePath, attrName, &attrValue, sizeof(attrValue), 00);

    return result == 0;

}


Posted by 닉네임영역
,


사랑합니다. 편안히 잠드소서