Re: bindings + actions
Re: bindings + actions
- Subject: Re: bindings + actions
- From: Jonathon Mah <email@hidden>
- Date: Sun, 21 May 2006 23:34:29 +0930
Hi Justin,
On 2006-05-21, at 23:01, Justin R. Miller wrote:
I have implemented bindings for some NSUserDefaults settings, but
some of the UI actions need to trigger events as well. For example,
not only do I want to toggle the user default BOOL, but I would
like to engage or disengage something at the same time.
I have found that binding the UI element as well as giving it a
target and action in IB does the trick. Is this the proper way to
do things?
I would recommend observing user defaults in your controller; either
by binding a controller key to the user defaults, or by using KVO
directly [userDefaults addObserver:...]. As you also mention, you can
listen on a notification, but I prefer using KVO since it will work
with all objects (regardless of whether they post a notification).
Jonathon Mah
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