• 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: CoreData based document NSUndoManager troubles
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CoreData based document NSUndoManager troubles


  • Subject: Re: CoreData based document NSUndoManager troubles
  • From: mmalcolm crawford <email@hidden>
  • Date: Thu, 18 Aug 2005 02:15:44 -0700


On Aug 17, 2005, at 3:13 PM, Colin Cornaby wrote:

Didn't fix anything. Here is my full method that needs to be undone:

NSData *oldData = [self valueForKey:@"data"];
[self setValue:someData forKey:@"data"];
[[[self managedObjectContext] undoManager] registerUndoWithTarget:self
selector:@selector(setResourceData:)
object:oldData];
[[[self managedObjectContext] undoManager] setActionName:@"Edit Resource"];


As Bill stated in his first reply, there should be no need for this line:

[[[self managedObjectContext] undoManager] registerUndoWithTarget:self
selector:@selector(setResourceData:)
object:oldData];


It's not clear why you still think it is necessary. It is almost certainly contributing to (if not actually representing the root cause of) any problems you might be seeing. What are you trying to achieve?


They look to be the same Undo Manager. I'm NSLogging at init, and NSLogging when I add the undo step, and they are both at the same address in memory.

"In a persistent document the undo manager functionality is taken over by managed object context."
<http://developer.apple.com/documentation/Cocoa/Reference/ ApplicationKit/ObjC_classic/Classes/NSPersistentDocument.html#// apple_ref/doc/uid/TP30001179-CJBFFIIJ>


See also: <http://developer.apple.com/documentation/Cocoa/Reference/ ApplicationKit/ObjC_classic/Classes/NSPersistentDocument.html#// apple_ref/doc/uid/TP30001179-CJBJEIAF>

mmalc

_______________________________________________
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: CoreData based document NSUndoManager troubles
      • From: Colin Cornaby <email@hidden>
References: 
 >Re: CoreData based document NSUndoManager troubles (From: Colin Cornaby <email@hidden>)

  • Prev by Date: Re: Anyone used iTableColumnHeader?
  • Next by Date: Re: Should I set Core Data dependent key in the primary's setter?
  • Previous by thread: Re: CoreData based document NSUndoManager troubles
  • Next by thread: Re: CoreData based document NSUndoManager troubles
  • Index(es):
    • Date
    • Thread