iPhone - how to store documents consisting of multiple images?
Posted
by Joe Strout
on Stack Overflow
See other posts from Stack Overflow
or by Joe Strout
Published on 2010-04-13T03:01:41Z
Indexed on
2010/04/13
3:02 UTC
Read the original article
Hit count: 409
My iPhone (actually, iPad) app creates documents that consist of several images, plus a bit of metadata. What's the best practice for storing these sorts of documents on disk? I see two main options:
Create a folder for each document, and store my images as separate PNG files within the folder (plus another little file for the metadata).
Create a single file which contains all images and metadata.
But I'm not sure how to easily do option 2. I think I can convert my images in PNG format to/from NSData, but then what? I'm still a newbie at Cocoa, but I believe I saw something about stuffing mixed data into some NSSomethingOrOther and having this write itself out to disk, and read itself back in later. Does this ring a bell with anyone? And, will it work with large binary blobs of data like my images?
Or would you recommend I simply go with option 1?
© Stack Overflow or respective owner