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

Disabling Undo in Core Data


  • Subject: Disabling Undo in Core Data
  • From: Squ Aire <email@hidden>
  • Date: Sat, 1 Aug 2009 12:11:53 +0000
  • Importance: Normal

I want to disable undo in Core Data. So far I can think of two ways to do that.



1) In awakeFromNib, call either   [[self managedObjectContext] setUndoManager:nil];   or  [[[self managedObjectContext] undoManager] disableUndoRegistration];   This certainly works, but the problem with this is that the   NSManagedObjectContextObjectsDidChangeNotification  will stop being sent when the context changes! This is not an option for me, as I rely on this notification a lot throughout my app. How come this notification is so dependent on having undo turned on? Seems weird to me that turning undo off would stop change notifications being sent out.



2) Which brings me to the second option. Keep the undo stuff there so that the NSManagedObjectContextObjectsDidChangeNotification will properly be sent out, as I want. However, instead just get rid of the Undo and Redo menu items. How good is this solution?



Therefore, method 1) isn't an option for me as I stop receiving notifications of changes. 2) might be an option, but might be a bad one in case I would one day like to add undoing for some selected feature in my app.



What do you all think?




--.
_________________________________________________________________
More than messages–check out the rest of the Windows Live™.
http://www.microsoft.com/windows/windowslive/_______________________________________________

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: Disabling Undo in Core Data
      • From: mmalc Crawford <email@hidden>
    • Re: Disabling Undo in Core Data
      • From: Jerry Krinock <email@hidden>
  • Prev by Date: Re: Core Data App With Auxiliary Panel
  • Next by Date: Re: Surprise: -[NSInvocation retainArguments] also Autoreleases them
  • Previous by thread: Re: Core Data App With Auxiliary Panel
  • Next by thread: Re: Disabling Undo in Core Data
  • Index(es):
    • Date
    • Thread