阅读背景:

如何在ios 5.0之前将文档备份停止到icloud

来源:互联网 

I am doing one application.In that i am creating the .txt files in DocumentDirectory at runtime.But they will backup to icloud.SO now i want to stop the backup in before ios 5 versions.From ios 5 onwards we have option to stop the back up process.I want to store the files in documents and not back up in before 5.0 versions.

我正在做一个应用程序。我在运行时在DocumentDirectory中创建.txt文件。但是他们将备份到icloud.SO现在我想在ios 5版本之前停止备份。从ios 5开始我们可以选择停止备份过程。我想将文件存储在文档中,而不是在5.0版本之前备份。

1 个解决方案

#1


0  

If you have installed ios version prior then ios5 then no data will backup to cloud. Becouse i-cloud comes with ios5.

如果您之前安装了ios版本ios5,那么没有数据会备份到云端。 Becouse i-cloud附带ios5。

In ios5.0 you can stop your backup with following function

在ios5.0中,您可以使用以下功能停止备份

(BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)URL {
    NSLog(@"in add skipBackUpAtrribute method.......");
    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;
}

分享到: