• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: UndoManager setActionNames
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: UndoManager setActionNames


  • Subject: Re: UndoManager setActionNames
  • From: Jean-Daniel via Cocoa-dev <email@hidden>
  • Date: Sun, 5 Jul 2020 10:27:55 +0200


> Le 5 juil. 2020 à 09:07, Arved von Brasch via Cocoa-dev
> <email@hidden> a écrit :
>
> Hi list,
>
> Where’s the best place to intercept undo/redo actions to edit the action name
> (’setActionName()’) for the UndoManager in a CoreData application? In
> particular, when a particular entity’s attribute's change. Obviously, I want
> to do this so that when the user edits something, the menu name is more
> descriptive than just “Undo”/“Redo”.
>
> Easiest, in terms of implementation, seems to be in the NSManagedObject
> subclass by means of an observer on the attribute. However, conceptually, it
> would make more sense to handle it in the NSArrayController or, maybe the
> NSTableView or other NSView object where the attribute is edited directly.
>
> Just wondering where others have settled for best practice.

Sometime, a user action may update many model fields in a single event loop (ie
in a single undo action).
If you try to set the action in the model, you won’t be able to reflect what
the user was doing.

_______________________________________________

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

References: 
 >UndoManager setActionNames (From: Arved von Brasch via Cocoa-dev <email@hidden>)

  • Prev by Date: UndoManager setActionNames
  • Next by Date: Correct icon height in status bar?
  • Previous by thread: UndoManager setActionNames
  • Next by thread: Correct icon height in status bar?
  • Index(es):
    • Date
    • Thread