iphone - 如何从 iPhone 应用程序将图像存储到 iCloud?

标签 iphone icloud photo-gallery

我在 iPhone 中有一个类似 MyPhoto Pro 应用程序的项目 App Store (website)。

请问有人可以帮助或指导我应该使用哪些技术和框架进行开发吗?

但我的首要任务是图像应该存储在 iCloud 中。

最佳答案

有关 iCloud 文件存储,请参阅 Designing for Documents in iCloud在文档中。

然后检查 NSFileManager 类,管理基于 ICloud 的项目部分。

  • -ubiquityIdentityToken检测 iCloud 可用性
  • -URLForUbiquityContainerIdentifier:获取 iCloud 目录(容器)的 URL
  • -setUbiquitous:itemAtURL:destinationURL:error:移动任何本地文件到 iCloud(反之亦然);一个 URL 必须是本地的,并且一个必须指向 iCloud 容器之一
  • -startDownloadingUbiquitousItemAtURL:error:下载文件内容
  • -evictUbiquitousItemAtURL:error:删除 iCloud 文件。

另请检查用于发现新 iCloud 文件的 NSMetadataQueryNSMetadataItem 类。 iCloud 将自动为您提供文件的仅元数据,但必须明确下载内容(请参阅上面的方法)

关于iphone - 如何从 iPhone 应用程序将图像存储到 iCloud?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14661043/

相关文章:

iphone - 无法在 bundle 中加载 NIB

ios - 为 iCloud "Manage Storage"列表指定应用名称

iphone - Iphone 中的 GridView 实现?

static - 最佳静态照片集生成器

iphone - 更改 uisegmentedcontrol 中选定段的字体

iphone - UIwebView链接延迟

swift - Watchkit 扩展无法从 iCloud 读取

ios - 是什么导致 iOS iCloud 错误 : Error Domain=BRCloudDocsErrorDomain Code=12 "The operation couldn’ t be completed.“延迟后重试:60

android - 如何在android中打开图库中的位图

iOS 警报 View Controller