• 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
Preventing Undo Registration when inserting into the MOC (managed object context)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Preventing Undo Registration when inserting into the MOC (managed object context)


  • Subject: Preventing Undo Registration when inserting into the MOC (managed object context)
  • From: email@hidden
  • Date: Thu, 2 Mar 2006 13:42:19 -0800

Hi list.

Currently, I have a value that is created passively, only when called in valueForKey.
This value is taken from a managed object that is created to supply the value.
And this value is only requested after being inserted into an array controller (its returning a value displayed in a table column).


I though disabling undo registration would fix this, but it doesn't because I get a "shadow" undo after insertion into the moc.
Also, creating an undo group wont work because after inserting an object into the array controller, the runloop finishes its current event, so by the time my "shadow" object is inserted, its too late to group it into the same undo group (IOW, making an undo group in - add: method of NSArrayController doesn't work).


Here is what I'm observing:

NSRunloop (begin event)
- array controller add:
NSRunloop (end event)

NSRunloop (begin event)
- table column -setNeedsDisplay:
- myItem -valueForKey:
- managed object context -insertObject: (HERE TURNING OF UNDO RESTORATION DOES NOT WORK APPARENTLY)
- myItem (return value)
NSRunloop (end event)


So, then clicking undo only un-does the last event (NSManagedObject _undoInsertions:)

How can I let the object context insert an object but have it not register it in the undo stack? (The inserted object deletes itself upon save it its "empty" anyways so its OK to have it "invisible")

Thanks in advance!

Andre
email@hidden



_______________________________________________
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: Preventing Undo Registration when inserting into the MOC (managed object context)
      • From: email@hidden
  • Prev by Date: Re: Delegate/Method called when key focus of NSTextView
  • Next by Date: NSTextView tab out of
  • Previous by thread: Re: Delegate/Method called when key focus of NSTextView
  • Next by thread: Re: Preventing Undo Registration when inserting into the MOC (managed object context)
  • Index(es):
    • Date
    • Thread