[Q] NSFileWrapper and document bundles
[Q] NSFileWrapper and document bundles
- Subject: [Q] NSFileWrapper and document bundles
- From: Steve Christensen <email@hidden>
- Date: Tue, 16 Mar 2004 19:10:29 -0800
I'm working on an application that manipulates document bundles rather
than a simple flat file. In my document class'
-loadFileWrapperRepresentation:ofType: method, I'm passed a pointer to
a NSFileWrapper representing the directory structure of the document.
Perhaps I've missed something in my reading, but I've found myself with
a couple of questions I can't answer:
1. Do the child NSFileWrappers representing files within the bundle
actually contain their file contents in a NSData object (in memory), or
are the contents left in the file on disk until they're actually
needed? The documentation says that you can get at a wrapper's file
contents by calling -regularFileContents but doesn't say if the
contents are already in memory.
2. Would it make sense to simply -retain the NSFileWrapper I'm passed,
making changes as appropriate as the document is edited, and then
return that NSFileWrapper in -fileWrapperRepresentationOfType: when the
document is saved? Would the retained NSFileWrapper have access to all
unmodified files if, for example, the document was being saved on top
of itself?
steve
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.