I am currently creating an app for iPad that allows users to add photos onto a canvas from their photo library. The user could potentially have 10, 20, 30, or more photos saved into the app.
Once added, these images are able to be manipulated (rotated, resized, etc.)...all of this information needs to be saved so it can be reloaded in the same state.
My current method of saving the information for each image is:
I am currently creating an app for iPad that allows users to add photos onto a canvas from their photo library. The user could potentially have 10, 20, 30, or more photos saved into the app.
Once added, these images are able to be manipulated (rotated, resized, etc.)...all of this information needs to be saved so it can be reloaded in the same state.
My current method of saving the information for each image is:
- What is the best way to manage data persistence in this particular situation?
- Is my current method for saving appropriate?...especially for such a potentially large amount of data?
Thanks!
If your "defaults" variable is referring to NSUserDefaults, then you should not store images or any other large files for that matter there. If I were storing many images and wanted to access them, I would store the images in the documents directory of the app and use CoreData as a means to access the filenames of those images. Then you could add data points that might be helpful for each image (edited, rotated, etc).
If your "defaults" variable is referring to NSUserDefaults, then you should not store images or any other large files for that matter there. If I were storing many images and wanted to access them, I would store the images in the documents directory of the app and use CoreData as a means to access the filenames of those images. Then you could add data points that might be helpful for each image (edited, rotated, etc).
Ed
Thanks for the reply.
Yes, I forgot to mention that the "defaults" variable was referencing NSUserDefaults.
If your "defaults" variable is referring to NSUserDefaults, then you should not store images or any other large files for that matter there. If I were storing many images and wanted to access them, I would store the images in the documents directory of the app and use CoreData as a means to access the filenames of those images. Then you could add data points that might be helpful for each image (edited, rotated, etc).
Ed
I have one more question that came to mind:
You recommended that I should save the images in the documents directory as opposed to saving the data through "archivedDataWithRootObject".
Can you elaborate as to why it is more memory efficient to actually save the file into the documents directory as opposed to saving it through "archivedDataWithRootObject"?
You recommended that I should save the images in the documents directory as opposed to saving the data through "archivedDataWithRootObject".
Can you elaborate as to why it is more memory efficient to actually save the file into the documents directory as opposed to saving it through "archivedDataWithRootObject"?
Thanks
Sorry, I was not, and can not without testing the case directly, saying to save the image or the NSData representation of the image. I was only saying it was not appropriate to save the image or data using NSUserDefault.
Ed