Re: NSDocument disc undo stack
Re: NSDocument disc undo stack
- Subject: Re: NSDocument disc undo stack
- From: Steven <email@hidden>
- Date: Tue, 03 Apr 2012 00:06:57 +0100
If there's no mechanism to persist the app undo states and undo manager messages, how should apps that support undo work with the automatic termination behaviour ?
Should automatic termination be set dynamically and disabled when undo history is present ?
A user might be annoyed if the undo history were lost when the app went off screen.
"the system may also quit an app with open windows if the app is not currently on screen, perhaps because the user hid it or switched spaces."
TextEdit (in 10.7) retains its undo history beyond save, until the document or application is closed.
Steven.
>
>
> On 25/03/2012, at 5:34 AM, Doug Clinton wrote:
>
>> I don't know if this was the issue that Steven was asking about, but I've been wondering if there is a recommended way to persist the undo stack so that it's still available if you restart the app, or close and re-open the document. It's always bothered me that there is this great mechanism for handling undo, but that all the history is thrown away when you close the app.
>
>
> No easy way I know of. The undo architecture relies on a huge amount of state within the app external to the undo stack itself. You'd have to save all of that state somehow.
>
> In fact, most apps throw away the undo history on a document save (you arrange this), as a way to recover the memory used by undo, since the whole state is being saved in the file anyway. Versions are the supported mechanism for persistent document undo.
>
> --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