Re: Linking the "document edited" flag to the Undo menu item state
Re: Linking the "document edited" flag to the Undo menu item state
- Subject: Re: Linking the "document edited" flag to the Undo menu item state
- From: Graham Cox <email@hidden>
- Date: Fri, 3 Apr 2009 15:24:50 +1100
On 03/04/2009, at 3:15 PM, Huibert Aalbers wrote:
Wow,
That certainly qualified as a simple solution :-) However, it didn't
work. Maybe that is because my application is not document-based.
Any additional suggestions?
Hrrm, well, you didn't actually mention that rather important fact...
Still, never mind, the solution is much the same. If your app isn't
document based, it sounds like perhaps there's a disconnect between
your undo manager and your window. To ensure this doesn't happen, make
sure you return your undo manager using the window delegate's method:
-windowWillReturnUndoManager:
So for example if the window delegate is the main controller that
manages the data model and the undo manager, it should just return the
undo manager using this method. Then the automatic management of the
window 'dirty' flag should work automatically as for doc-based apps.
--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