Re: UIDocument with NSFileWrapper
Re: UIDocument with NSFileWrapper
- Subject: Re: UIDocument with NSFileWrapper
- From: email@hidden
- Date: Sat, 19 Mar 2016 21:54:11 -0400
> On Mar 19, 2016, at 8:01 PM, Quincey Morris <email@hidden> wrote:
>
> On Mar 19, 2016, at 14:23 , email@hidden wrote:
>>
>> My thought is to have a dictionary mapping each image filename to a NSFileWrapper
>
> You already have one, basically. The top level wrapper for a package is a directory wrapper, which lists the wrappers of contained files, indexed by file name.
Yes, right now I have that wrapper saving a JSON file that I read/write back into my model.
The documentation I found for NSFileWrapper handles the case where there are a fixed number of files with names known at compile time so I’m struggling to understand what to do when the number of files can vary and the names aren’t known at compile time.
What I’m having trouble understanding is how I store the images (whose filenames will vary from document to document) with NSFileWrapper. In my top level directory do I have my main model file as a JSON file along with a file (JSON or plist) that lists all the images and then have an Image directory that another NSFileWrapper is used to read/write the images (that are stored in the Image subdirectory)?
Or can I simply store all the files without a subdirectory? I still suspect I need to have a file with a fixed name (such as image.plist) that tells me what all the other filenames are to put in the NSFileWrapper (vs. using NSFileManager to ask for the name of all the files).
Thanks for all your input.
Dave Reed
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden