• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

照片框架创建的相册的图像的iCloud同步

用户头像
it1352
帮助1

问题说明

TL; DR-使用 [PHAssetCollectionChangeRequest creationRequestForAssetCollectionWithTitle:@"ALBUM_TITLE"]; 创建的相册是否可以通过iCloud同步?并在每台设备上同步的图像都具有相同的 localIdentifier 吗?

在我的App中,我需要存储用户通过使用相机或从照片库添加现有照片而添加的许多不同的相册/照片文件夹.理想情况下,我想要的是应用程序中的所有照片都位于照片应用程序中的同一张(特定于我的应用程序)相册中,以便该相册可以通过iCloud进行同步,并且我可以存储对特定相册的引用相册中的照片,因此我可以将这些照片重新放入应用程序中的单独相册.

In my App I need to store a number of distinct albums/folders of photos that the user adds by either using the camera or adding an existing photo from the photo library. Ideally what I want is all the photos from the app to be located in the same one (specific to my app) album in the Photos app, for this album to sync over iCloud, and for me to be able to store references to the specific photos in this album so I can then resort these photos to the separate albums in my app.

我可以为图像创建相册,将图像的localIdentifier存储在数组中,然后使用fetchAssetsWithLocalIdentifiers:options:来获取图像.

I can create an album for the images, store the image's localIdentifier's in an array and use fetchAssetsWithLocalIdentifiers:options: to get the images.

问题是使这些图像通过iCloud进行同步.我使用[PHAssetCollectionChangeRequest creationRequestForAssetCollectionWithTitle:@"ALBUM_TITLE"];创建的相册会在iCloud上同步吗?据我所知,如果用户未启用iCloud照片库,则它不会同步,但会与iCloud照片库同步,对吗?

The problem is getting these images to sync over iCloud. Will an album I create using [PHAssetCollectionChangeRequest creationRequestForAssetCollectionWithTitle:@"ALBUM_TITLE"]; sync over iCloud? From what I can tell, if the user doesn't have iCloud Photo Library enabled then it won't sync, but it will sync with iCloud Photo Library, is that correct?

如果它将通过iCloud同步,相册中图像的localIdentifier是否相同,或者当这些图像下载到新设备时会获得新的标识符吗?如果它们确实获得了新的标识符,我该如何存储对将在设备之间保留的特定图像的引用?

If it will sync over iCloud, will the localIdentifier for the images in the album be the same, or will these get a new identifier when they download to a new device? If they do get new identifiers how can I store a reference to specific images that will persist across devices?

注意:我暂时无法访问支持iCloud的设备对此进行测试

正确答案

#1

经过测试,似乎所有创建的PHAsset都会在iCloud上同步. (我仅在打开iCloud照片库的情况下对此进行了测试,因此不能100%地确定是否为其他方式).

After testing it seems that any PHAssets created will sync over iCloud. (I've only tested this with iCloud Photo Library turned on so not 100% sure otherwise).

PHAsset的localIdentifier似乎也正是他们所说的:本地的,不会在设备之间持久存在.

It also seems that the localIdentifier of PHAssets are exactly what they say: local, and won't persist across devices.

这篇好文章是转载于:学新通技术网

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 学新通技术网
  • 本文地址: /reply/detail/tanhcfjgja
系列文章
更多 icon
同类精品
更多 icon
继续加载