• 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: Adding actions to undo manager
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Adding actions to undo manager


  • Subject: Re: Adding actions to undo manager
  • From: Kyle Sluder <email@hidden>
  • Date: Mon, 15 Jun 2009 18:34:39 -0700

On Mon, Jun 15, 2009 at 6:18 PM, Ryan Joseph<email@hidden> wrote:
> I'm not sure I follow you. How do I know the user wants to undo and that it
> was in response to my change of the NSTextStorage? It seems like one way or
> another I need to keep a stack of changes with information on what operation
> they performed to the NSTextStorage. Thanks.

You already can.

Undo and Redo are typically view-centered operations.  That is, they
perform actions in response to things the user does with your views.
If they type into an NSTextView, the NSTextView ensures that, in
response to their typing, the undo stack is updated.

You're essentially assuming the role of NSTextView here.  Instead of
providing methods like -cut:, you're providing some method
-doCustomThing:.  -doCustomThing:, like -cut:, operates on the
NSTextStorage instance.  And just like Apple had to when they wrote
-cut:, you need to provide undo/redo support in your implementation of
-doCustomThing:.

--Kyle Sluder
_______________________________________________

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

  • Follow-Ups:
    • Re: Adding actions to undo manager
      • From: Ryan Joseph <email@hidden>
References: 
 >Adding actions to undo manager (From: Ryan Joseph <email@hidden>)
 >Re: Adding actions to undo manager (From: Kyle Sluder <email@hidden>)
 >Re: Adding actions to undo manager (From: Ryan Joseph <email@hidden>)
 >Re: Adding actions to undo manager (From: "I. Savant" <email@hidden>)
 >Re: Adding actions to undo manager (From: Ryan Joseph <email@hidden>)

  • Prev by Date: Re: Adding actions to undo manager
  • Next by Date: Re: Adding actions to undo manager
  • Previous by thread: Re: Adding actions to undo manager
  • Next by thread: Re: Adding actions to undo manager
  • Index(es):
    • Date
    • Thread