Advice on document handling
Advice on document handling
- Subject: Advice on document handling
- From: John Brownie <email@hidden>
- Date: Tue, 10 Jun 2014 11:28:48 +1000
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, email@hidden or email@hidden
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 (email@hidden)
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:
This email sent to email@hidden