2013-02-01 69 views

回答

0

否。如果用戶在其設備上具有密碼,則NSFileProtectionComplete僅對核心數據文件進行加密。它不會更改設備的備份行爲。

控制備份行爲變化的IOS版本http://developer.apple.com/library/ios/#qa/qa1719/_index.html#//apple_ref/doc/uid/DTS40011342

在5.1和更高版本可以使用

assert([[NSFileManager defaultManager] fileExistsAtPath: [URL path]]); 

NSError *error = nil; 
BOOL success = [URL setResourceValue: [NSNumber numberWithBool: YES] 
           forKey: NSURLIsExcludedFromBackupKey error: &error]; 
if(!success){ 
    NSLog(@"Error excluding %@ from backup %@", [URL lastPathComponent], error); 
}