• 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
NSUndoManager - grouping undo actions in Core Data
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSUndoManager - grouping undo actions in Core Data


  • Subject: NSUndoManager - grouping undo actions in Core Data
  • From: Dave Fernandes <email@hidden>
  • Date: Wed, 25 Apr 2007 17:54:43 -0400

I am having trouble getting the desired behavior for undoing actions in a CD app. My immediate problem is that I would like to group some actions across events.

I tried [undoManager beginUndoGrouping] with a matching [undoManager endUndoGrouping], but I get a crash when undoing. The app was quite stable without grouping the actions.

I then tried calling
[undoManager beginUndoGrouping];
[undoManager setGroupsByEvent:NO];

- it must be done in this order, or no undo group gets created

I then call [undoManager endUndoGrouping] after the last update to my managed objects... Now everything works like I would like as far as grouping actions.

The problem is that I am unable to successfully re-enable grouping by event. I call [undoManager setGroupsByEvent:YES], and then [undoManager groupsByEvent] returns YES. But when I try to update another managed object without manually creating an undo group, I get an exception that "NSUndoManager is in an invalid state, must begin a group before registering undo"

So how can I re-enable grouping by event? Or how can I group actions without first disabling grouping by event?

Dave
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
    • How to debug CoreData/NSTreeController crash during undo? (was: NSUndoManager - grouping undo actions...)
      • From: Dave Fernandes <email@hidden>
  • Prev by Date: Re: Convert HTML to plain text
  • Next by Date: Re: Inserting localized text to NSTextView
  • Previous by thread: Re: Cannot get toolbar to appear in window
  • Next by thread: How to debug CoreData/NSTreeController crash during undo? (was: NSUndoManager - grouping undo actions...)
  • Index(es):
    • Date
    • Thread