• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
[Q] NSFileWrapper and document bundles
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[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.


  • Prev by Date: Re: Loading an bitmap from NSImage with alpha?
  • Next by Date: Why can I make a new document this way?!
  • Previous by thread: Re: Drag + Drop in Tableview using NSArrayController
  • Next by thread: Why can I make a new document this way?!
  • Index(es):
    • Date
    • Thread