Re: Bindings, Dicts and Cancel Window
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