> On 2015 Sep 08, at 21:04, Alex Hall <mehg...@icloud.com> 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 (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to