1
startDownloadingUbiquitousItemAtURL:error
方法在本地保存下载的文件在哪里?
是否与URL
相同?startDownloadingUbiquitousItemAtURL本地文件路径?
startDownloadingUbiquitousItemAtURL:error
方法在本地保存下载的文件在哪里?
是否与URL
相同?startDownloadingUbiquitousItemAtURL本地文件路径?
是,其相同的URL
到位文件从iCloud中下载到设备之前是各种各样的占位符。
您可以检查URL的状态与键NSURLUbiquitousItemIsDownloadedKey
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];
}
世界上没有错误在片段,你会希望在生产代码做处理。