R – How to avoid copying duplicate images to the iPhone Photo Library

duplicatesfileimageiphonephotolibrary

I am writing a simple application to copy a set of images to the user's photo library so that the user may use them as backgrounds. The problem is that if the user runs the application more than once, duplicate images will be copied to the photo library. Given the restrictions Apple places on accessing the contents of the photo library, what is the simplest way, if any, to avoid writing a duplicate file to the library?

Ben

Best Answer

You can store the images data that have been saved in your application by writing them to a file or using Core Data, that way you know which have been saved and which have not. Y