My app can handle documents in two different forms. One is a simple file, while the other is a bundle that can contain one or more of that same kind of file plus some metadata about them.

The simple file is handled as an NSDocument subclass, and is written out with dataOfType:error:. It returns YES from autosavesInPlace.

The bundle is also an NSDocument subclass. It also returns YES from autosavesInPlace, but it writes data with createFileWrapper. At this point, this builds a complete new bundle, not attempting to copy files that haven't been changed.

I seem to be hitting a deadlock occasionally on save. I think that the problem is likely to involve the fact that documents can be owned by both the bundle document class and the simple document class, and trying to save the same document may be leading to the problem. So far, I haven't been able to reproduce the problem in a way to get a meaningful trace.

Before I spend too much longer on this, am I handling the two document types in a safe manner? Or is there another pattern I should be using for this sort of nested document?

Thanks for any pointers here.

John
--
John Brownie, john_brow...@sil.org or j.brow...@sil.org.pg
Summer Institute of Linguistics      | Mussau-Emira language, Mussau Is.
Ukarumpa, Eastern Highlands Province | New Ireland Province
Papua New Guinea                     | Papua New Guinea
_______________________________________________

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