• 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
Forcing undoManager to start a new group?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Forcing undoManager to start a new group?


  • Subject: Forcing undoManager to start a new group?
  • From: Duncan Campbell <email@hidden>
  • Date: Mon, 12 Dec 2005 17:52:32 +1100

Hi list.

I have an NSDocument subclass wired up to an NSTextView, that I having some difficulty with the default undoManager behaviour:

When i save my document (not using any of the NSDocument save methods - this could be the problem), I wish to "reset" the undoManager so that any typing registers as a new undo. However, I do not want to do removeAllActions: since i still want to be able to undo after save.

In searching thru the list it would seem that sending NSChangeDone to updateChangeCount: does what I want (referenced here: http:// www.cocoabuilder.com/archive/message/cocoa/2005/3/2/129331), but this does not seem to be working - performing undo after this method call undoes the previous action also.

I have also tried beginUndoGrouping: but this gives errors about nested groups when i undo.

Can anyone shed any light on this?

Many thx.

Duncan

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
  • Follow-Ups:
    • Re: Forcing undoManager to start a new group?
      • From: "Timothy J. Wood" <email@hidden>
  • Prev by Date: Re: How to adjust refCount?
  • Next by Date: Re: Can I Send Apple Events in Cocoa?
  • Previous by thread: Re: How to adjust refCount?
  • Next by thread: Re: Forcing undoManager to start a new group?
  • Index(es):
    • Date
    • Thread