#import <sys/xattr.h>
// 백업안되게 설정. (2.23리젝 방지)
NSArray* aryPath = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSURL* documentURL = [NSURL fileURLWithPath:[aryPath objectAtIndex:0]];
[self addSkipBackupAttributeToItemAtURL:documentURL];
//------------------------------------------------------------------------------
// 백업 안되게 설정 (icloud, itunes)
//------------------------------------------------------------------------------
- (BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)URL
{
const char* filePath = [[URL path] fileSystemRepresentation];
const char* attrName = "com.apple.MobileBackup";
u_int8_t attrValue = 1;
int result = setxattr(filePath, attrName, &attrValue, sizeof(attrValue), 0, 0);
return result == 0;
}
'iOS 초보' 카테고리의 다른 글
CoreText (0) | 2015.06.17 |
---|---|
CoreBluetooth 기본 (0) | 2015.05.21 |
pdf, horizonal, paging (0) | 2015.05.08 |
perform block with delay (0) | 2015.04.28 |
status bar 객체 얻기 (0) | 2015.04.07 |