• 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: Safely cancelling modifications
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Safely cancelling modifications


  • Subject: Re: Safely cancelling modifications
  • From: "R. Matthew Emerson" <email@hidden>
  • Date: Thu, 23 Nov 2006 10:42:36 -0500


On Nov 23, 2006, at 3:03 AM, Eric Morand wrote:

I have an editor window, with a 'OK' button and a 'Cancel' button (just like the iTunes one). The text fields in the window are bound to the managed object attributes. So, when the user changes a value in a field, the managed object is automatically modified with the entered value.

What I want is to allow the user to cancel every modification done since the editor window has been opened when he clicks on Cancel.

You could use a separate managed object context for the editor window. When you show the window, create a managed object in the local context and fill in its attributes. If the user clicks OK, copy back the attributes to the "real" object in the main context. Otherwise, you just ignore the edits made in the local context and send it a reset message.


See the Department and Employees 2 example over at http:// homepage.mac.com/mmalc/CocoaExamples/controllers.html.


_______________________________________________

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


References: 
 >Safely cancelling modifications (From: Eric Morand <email@hidden>)

  • Prev by Date: Re: Rendering strokes without using NSBezierPath
  • Next by Date: Simulate Context Menu with Window
  • Previous by thread: Safely cancelling modifications
  • Next by thread: Can't get my application to see my Help Folder - Thank you
  • Index(es):
    • Date
    • Thread