Iphone 开始下载BIQUITOUSSITEMATURL本地文件路径?
Iphone 开始下载BIQUITOUSSITEMATURL本地文件路径?,iphone,ios,objective-c,ipad,icloud,Iphone,Ios,Objective C,Ipad,Icloud,startdownloadingbiquitousitemature:errormethod在哪里将下载的文件保存到本地? 它与给定的URL相同吗?是的,它是相同的URL 从iCloud下载到设备之前的文件是某种占位符 您可以使用键nsurlubiquitousitemsdownloaddedkey NSURL *foo = file://cloud/container/reference/tofile; NSNumber *isDownloadedValue = NULL; BOOL su
startdownloadingbiquitousitemature:error
method在哪里将下载的文件保存到本地?它与给定的
URL
相同吗?是的,它是相同的URL
从iCloud下载到设备之前的文件是某种占位符
您可以使用键nsurlubiquitousitemsdownloaddedkey
NSURL *foo = file://cloud/container/reference/tofile;
NSNumber *isDownloadedValue = NULL;
BOOL success = [foo getResourceValue:&isDownloadedValue forKey: NSURLUbiquitousItemIsDownloadedKey error:NULL];
if (success && ![isDownloadedValue boolValue]) {
[[NSFileManager defaultManager] startDownloadingUbiquitousItemAtURL:foo error:NULL];
}
该代码段中没有您希望在生产代码中执行的错误处理