Hi All,

I'm seeing something a bit odd with NSDocument in 10.7.

We're writing large files to our own package, so as a result I've overridden:

- (BOOL) writeToURL:ofType:forSaveOperation:originalContentsURL:error:
- (BOOL)readFromURL:ofType:error:

+ (BOOL) autosavesInPlace - is fixed to return YES.

We have a single index file at the root of the bundle, plus a subfolder called 
"assets", which while initially empty will get filled with files as we "do 
stuff" with the document.  Note: the addition of files to this folder can and 
does occur outside of specific calls to the document. 
 
Now, what I'm seeing is this:

1) Make a new doc
2) Put some additional files within the assets folder of the doc
3) Save the new (presently Untitled) doc to the Desktop
4) Result: The saved doc *no longer contains the asset file*

What I understand (according to the NSDocument headers) is that 
writeSafelyToURL:ofType:forSaveOperation:error: is supposed to do "a 
bunch-o-stuff" (as outlined in the headers).  And, importantly, at the end

"    4) Moves the just-written file to its final location, or deletes the old 
on-disk revision of the document, and deletes any temporary directories, 
depending on the same factors listed for step 1."

I can see our write call made, to the unsaved doc in ~/Library/Autosave 
Information/.  If I open this bundle in Finder, the contents are saved just 
fine, and there is a single asset in the assets folder. This is expected.

However; it doesn't get moved (point 4 above) correctly.
When I open the moved document on the Desktop, it's got it's index file, and an 
assets folder, but there are NO assets inside that folder. It's like the move 
operation moved everything at level 1, and didn't take into account subfolders. 
 


Any ideas?

--
Neil Clayton





_______________________________________________

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