Re: Advice on document handling
Re: Advice on document handling
- Subject: Re: Advice on document handling
- From: John Brownie <email@hidden>
- Date: Fri, 20 Jun 2014 15:15:34 +1000
On Fri Jun 20 2014 12:58:11 GMT+1000 (PGT) Graham Cox wrote:
On 20 Jun 2014, at 12:37 pm, John Brownie <email@hidden> wrote:
OK, thank you for the pointers. After a lot of refactoring, I've got things working without deadlocks, and cleaned up various things on the way.
However, the autosave is getting too expensive for the bundled document.
One strategy might to make it less expensive. How are you saving stuff? Archiving? Are you allowing it to save in the background?
It's serialising a tree-structured document as XML (I don't control the
format of the XML document) and then write it to disk. The writing seems
to be taking the time, even if it's wrapped in a dispatch_async block.
Well, you might have to end up rolling your own solution to tracking
which files have changed. You probably can't rely on NSUndoManager,
that's not really its job, and in any case it's a very opaque object.
Your document could certainly manage a list of URLs that it knows have
changed, and this list could be maintained in some simple manner by
your code as it works, in addition to any normal undo. It's for you to
figure it out though, as it will depend entirely on what your document
does and how it does it.
That's what I was afraid of. Looks like I need to keep a local flag for
when the document gets changed and when it gets saved.
Thanks,
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