On Mar 19, 2016, at 18:54 , davel...@mac.com wrote:
> 
> 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).

There’s no correct answer to these questions. It’s a design problem whose 
answer is whatever works best in your use case. I’d recommend you start by 
choosing what looks to you like the most straightforward approach, then be 
prepared to revise your strategy later if it doesn’t work out well. (The amount 
of code relating to file wrappers is likely to be small relative to the code 
that generally maintains your data model, so rewriting it shouldn’t be onerous. 
However, that suggests it would be prudent not to let the wrappers propagate 
too deeply into the model. Keep them as an artifact of the save mechanism in 
particular, rather than the data model in general.)

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to