开发者

iPhone - how to store documents consisting of multiple images?

开发者 https://www.devze.com 2022-12-26 09:00 出处:网络
My iPhone (actually, iPad) app creates documents that consist of several images, plus a bit of metada开发者_StackOverflowta.What\'s the best practice for storing these sorts of documents on disk?I see

My iPhone (actually, iPad) app creates documents that consist of several images, plus a bit of metada开发者_StackOverflowta. What's the best practice for storing these sorts of documents on disk? I see two main options:

  1. Create a folder for each document, and store my images as separate PNG files within the folder (plus another little file for the metadata).

  2. 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?


Simply go with option1. It's clean, elegant, and simple to implement. You could even use (a subset of) HTML.


TIFFs and PDFs can have multiple pages.


Creating a document centric iPhone/iPad application with own file format using ZipArchive

0

精彩评论

暂无评论...
验证码 换一张
取 消