Re: Advice on document handling
Re: Advice on document handling
- Subject: Re: Advice on document handling
- From: Graham Cox <email@hidden>
- Date: Fri, 20 Jun 2014 12:58:11 +1000
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?
> However, I haven't been able to find out how to determine if a particular object has changed since the version on disk. In particular, there is only one undo manager for the document, but there are several files that are managed by the document, and I can't see how to see what has changed.
>
> I must be missing something obvious, so would welcome someone pointing me in the right direction on this one.
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.
--Graham
_______________________________________________
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