问题
I am actually creating an iOS app, and want to store some details about Photo Library pictures in an SQLite database. I also would like to be able to share this data across the different devices the user has (imagine someone wanted to reorganize pictures on his iPhone, and wants to retrieve the same order in his iPad).
I have searched across the Apple documentation, but did not find any PHAsset
identifier that is shared across devices. I also tried to check if the PHImageFileURLKey
, hashValue
, or localIdentifier
of the PHAsset
where shared, but none of them are.
Has someone already done something like this?
回答1:
There is none at the moment. PHAsset had a shared identifier in the first iOS 8 Betas, but it was removed later on.
回答2:
It looks like, that for all PHAssets that have been synced with iTunes, the localIdentifier is identical, even across devices. Means: if you import images from one device and sync them to another device, the localIdentifier of the PHAsset is identical.
来源:https://stackoverflow.com/questions/28690304/phasset-or-alasset-cross-device-identifier