Leena
Leena

Reputation: 2676

ALAssetURL unique even after SYNC ipad/iPhone with iTunes

The documentation describes it as 'persistent' (http://developer.apple.com/library/ios/documentation/AssetsLibrary/Reference/ALAssetRepresentation_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40009728-CH1-SW16) but does this mean persistent over a single sync, persistent until new photos are added, persistent until old photos are deleted, or what? If I build a database that associates photo elements in the Camera Roll/Photo Library to data in my application using their ALAssetRepresentation url's, will these associations continue to work forever, even if the photos are moved or renamed?

If Asset url are not unique after sync then what is the alternate solution for this as i need to identify assets uniquely even after sync.

Upvotes: 1

Views: 173

Answers (1)

holtmann
holtmann

Reputation: 6303

In my experience, the URLs are persistent between syncs (starting in iOS 5). But once the device is restored from an iTunes backup or from iCloud, the assets will get new URLs. This also happened after the upgrade from iOS 5 to iOS 6. The alternative would to generate an own ID/Checksum for every photo: e.g. take the filename, recording date and file size and generate an MD5 or SHA1 Hash from it.

Upvotes: 1

Related Questions