Re: Any reason to bind NSButtons?
Re: Any reason to bind NSButtons?
- Subject: Re: Any reason to bind NSButtons?
- From: "b.bum" <email@hidden>
- Date: Sun, 16 May 2004 13:56:50 -0700
On May 16, 2004, at 1:10 PM, Peter Wollschlaeger wrote:
I'm convinced to use binding with table views and user defaults but is
there any advantage to apply binding to buttons?
I'm wondering because non of the examples demonstrating binding use
for buttons, but in that case just the conventional way.
For your basic target/action type stuff, using bindings vs. T/A makes
little difference.
However, there are a number of situations where you can use Bindings
where T/A would not work.
For example, target/action bindings allows you to execute just about
any method on the target that you want, including passing arguments to
the method. I have used this effectively to implement a single action
method where the arguments are used to determine which objects should
be affected by the action. In some cases, this has meant passing the
selection of an array controller through as the argument to the action,
thereby making the action operate upon the selected items in a table
view without requiring any code to gather or track the selection
manually.
b.bum
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.