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

Observing Undo in a Core Data App


  • Subject: Observing Undo in a Core Data App
  • From: Michael Clark <email@hidden>
  • Date: Fri, 24 Feb 2006 09:07:36 -0700

Hi all,

I'm looking for a little insight and a point in the right direction on an issue:

I have created an application using the Core Data application template in XCode.

* Upon start up, I fetch a bunch of managed objects into an array stored in my controller object.

* I bind that array, through Key binding to an array controller. Wired together in IB. The controller is configured to create new content, delete upon removal.

* I display the objects in the array controller into a table view, again wired in IB.

* There is an "Add" button, wired in IB to the add: action of the array controller.

* There is a "Remove" button, wired in IB to the remove: action of the array controller.

Pressing add and delete does as it should, a new object is and added to the array, or delete. I KVO my array and see items being added and removed so I can make small updates to my UI. All good.

Undo, however, inserts objects back into the context, as it should. But my array is not automatically updated - it's not programmed to be so - it's only loaded on application start.

What do I observe to see if an item has been placed back into the NSManagedObject context via Undo. Undo works: the most recently deleted object is put back into the context - it's there when I restart the application and reload the array. I just need to know when an object is put back into the context so that I can update my UI on the fly. Any suggestions on how to do this?

Thank you,

Michael Clark
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: Observing Undo in a Core Data App
      • From: Joshua Scott Emmons <email@hidden>
  • Prev by Date: double-binding?
  • Next by Date: Re: double-binding?
  • Previous by thread: Re: double-binding?
  • Next by thread: Re: Observing Undo in a Core Data App
  • Index(es):
    • Date
    • Thread