startDownloadingUbiquitousItemAtURL本地文件路径?

Aakpro

startDownloadingUbiquitousItemAtURL:error方法在哪里将下载的文件保存在本地?
与给定的一样URL吗?

沃伦·伯顿(Warren Burton)

是的,它是相同的网址

从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];
}

您希望在生产代码中执行的代码段中没有错误处理。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章