Re: Basics of Cocoa Bindings
Re: Basics of Cocoa Bindings
- Subject: Re: Basics of Cocoa Bindings
- From: Jerry Krinock <email@hidden>
- Date: Tue, 08 Sep 2015 22:05:10 -0700
> On 2015 Sep 08, at 21:04, Alex Hall <email@hidden> wrote:
>
> why are keyPathsForValuesAffecting<Key> needed? Is this method taking the place of something I might do in IB, or is this something different?
Of course, they are not required, as many successful apps were written before we had Cocoa Bindings. One alternative is to write custom setters for all of the other values that affect Key. Such setters change the value of Key (watch out for infinite loops). Another, worse alternative is to put such code into the view controller. (Breaks if someone decides to add more views, or AppleScript support for changing properties, etc.)
These older methods still work. However, in my experience, Cocoa Bindings and keyPathsForValuesAffecting<Key> are less fragile, simpler and better for most applications.
I do not think there are any alternatives to keyPathsForValuesAffecting<Key> in Interface Builder.
_______________________________________________
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