有没有办法阻止您的应用程序数据(文档文件夹内容)同步到 iCloud?(由于 iOS5 中的新问题,因此将其存储在 Caches 目录中)我的应用程序需要在设备上存储数据,但出于安全原因,它不能同步到任何第三方(包括 Apple)。
问问题
7588 次
2 回答
8
From: https://developer.apple.com/library/ios/#qa/qa1719/_index.html
You can use the following method to set the "do not back up" extended attribute. Whenever you create a file or folder that should not be backed up, write the data to the file and then call this method, passing in a URL to the file.
#include <sys/xattr.h>
- (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;
}
More information can be found: https://developer.apple.com/icloud/documentation/data-storage/
于 2011-11-03T17:44:48.623 回答
0
它描述了一个应用程序必须使用 iCloud 权利进行签名,所以这似乎暗示如果你什么都不做,那么你应该没问题。
于 2011-10-14T19:51:45.507 回答