• 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: Bindings, Dicts and Cancel Window
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bindings, Dicts and Cancel Window


  • Subject: Re: Bindings, Dicts and Cancel Window
  • From: Mike Abdullah <email@hidden>
  • Date: Sun, 23 Jul 2006 17:59:42 +0100

If it's preferences, then have a look at the setAppliesImmediately: and other methods of NSUserDefaultsController.

If on the other hand, you're not actually using the defaults, two suggestions:

	1.
Scrap the Cancel button and make the user's changes "live"

2.
When you're editing the sheet, bind the controls to a temporary model object. If the use clicks cancel, just discard this object, if not copy it's values to the central model object.


Mike.

On 23 Jul 2006, at 1:06PM, Trygve Inda wrote:

I have a prefs-like window with all the control values attached to
key/values in a dict through bindings. Works great.

I need to be able to handle the situation where the user clicks cancel, and
since they are bindings there are updated on the fly as the user is clicking
so my thought is...


Before showing the window, use CFPropertyListCreateDeepCopy to copy the
dict.


Now, how do I insert it back in a KVO way - or does it need to be KVO at
all? Can I just replace the entire (newly modified) dictionary with the old
one, or do I need to step through each key and insert the old values into
the newly modified dict.


I hope this is clear.

Trygve


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40gmail.com


This email sent to 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: Bindings, Dicts and Cancel Window
      • From: mmalc crawford <email@hidden>
References: 
 >Bindings, Dicts and Cancel Window (From: Trygve Inda <email@hidden>)

  • Prev by Date: Re: Design patterns
  • Next by Date: Re: Sending non-string parameters to an AppleScript
  • Previous by thread: Bindings, Dicts and Cancel Window
  • Next by thread: Re: Bindings, Dicts and Cancel Window
  • Index(es):
    • Date
    • Thread