Re: Combing Bindings with Target-Action
Re: Combing Bindings with Target-Action
- Subject: Re: Combing Bindings with Target-Action
- From: "Jeremy W. Sherman" <email@hidden>
- Date: Thu, 16 Apr 2009 00:12:16 -0400
> I am relying on the binding messages to complete before the
> target-action message - is this an OK idea?
It sounds like you already know the answer to that. It's likely not
worth the trouble of trying to straighten out the race condition, when
you can just dodge the problem entirely and use KVO, as Kyle
suggested.
If you find KVO overly ugly, there are wrappers around it, such as one
provided by Mike Ash (see
http://www.mikeash.com/?page=pyblog/key-value-observing-done-right.html;
the code itself is available both at
http://mikeash.com/svn/MAKVONotificationCenter/ and through GTM at
http://code.google.com/p/google-toolbox-for-mac/source/browse/trunk/Foundation/GTMNSObject+KeyValueObserving.m).
—Jeremy
On Wed, Apr 15, 2009 at 11:26 PM, Kyle Sluder <email@hidden> wrote:
> On Wed, Apr 15, 2009 at 3:04 PM, Jeff Hutchison
> <email@hidden> wrote:
>> I am relying on the binding messages to complete before the
>> target-action message - is this an OK idea?
>
> Why not just register as an observer of the bound property?
>
> --Kyle Sluder
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please 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
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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