• 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
Core Data & Undo Problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Core Data & Undo Problem


  • Subject: Core Data & Undo Problem
  • From: Jean-Olivier Lanctôt <email@hidden>
  • Date: Tue, 6 Feb 2007 16:27:19 -0500

Hello,

So I'm trying to disable undo for a specific action (removal of objects)

NSUndoManager *undoMgr = [[self managedObjectContext] undoManager];

		[undoMgr disableUndoRegistration]; // Disable it for the time being
		[filesArrayController removeObjects:files];
		[filesArrayController commitEditing];
		[undoMgr enableUndoRegistration]; // Enable it finally

The goal of disabling and then enabling the undo manager for my context was to make sure the removal of objects in "files" could
not be undone.


But this doesn't work, even if I -commitEditing.

It seems like the NSArrayController is -registerUndoWithTarget *later* (after the manager has been enabled).
So the problem is -- where/when should I call -enableUndoRegistration (it should be AFTER the array controller tries registering the action)?


I even tried to enable with a delay (perform selector with delay), but no luck there.

Thanks for any help.. I'm totally puzzled here.

--Olivier

P.S. It works if I don't ever call -enableUndoRegistration, so this tells us it's just a matter of knowing when to enable registration.
_______________________________________________


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:
    • Re: Core Data & Undo Problem
      • From: "Kevin" <email@hidden>
    • Re: Core Data & Undo Problem
      • From: Jim Correia <email@hidden>
  • Prev by Date: Re: Passing parameter to NSValueTransformer
  • Next by Date: Re: Core Data & Undo Problem
  • Previous by thread: Re: Passing parameter to NSValueTransformer
  • Next by thread: Re: Core Data & Undo Problem
  • Index(es):
    • Date
    • Thread