FROM : Mike Abdullah
DATE : Sun Jul 23 18:59:42 2006
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_removed>)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/mike.abdullah%
> 40gmail.com
>
> This email sent to mike.<email_removed>
DATE : Sun Jul 23 18:59:42 2006
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_removed>)
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/mike.abdullah%
> 40gmail.com
>
> This email sent to mike.<email_removed>
| Related mails | Author | Date |
|---|---|---|
| Trygve Inda | Jul 23, 14:06 | |
| Mike Abdullah | Jul 23, 18:59 | |
| mmalc crawford | Jul 23, 19:27 |






Cocoa mail archive

