Re: Using Target/Argument Bindings
Re: Using Target/Argument Bindings
- Subject: Re: Using Target/Argument Bindings
- From: mmalcolm crawford <email@hidden>
- Date: Sun, 26 Oct 2003 23:04:53 -0800
On Oct 26, 2003, at 7:48 PM, Owen Anderson wrote:
Take a look at the example in the CocoaDocs. It criticizes the older
style of having a separate action being called depending on which
radio button was selected. It then instructs you to implement this
with Bindings. However, doing it with Bindings requires you to write
a method for each radio button that returns a unique identified string
like "OutputHTML". My point was that overall you haven't saved
anything, and that personally I'd prefer the older style since it's
actually clear what the code is trying to to do, rather than having
lots of little methods that just return strings.
I think you missed the point.
(a) You may well require "lots of little methods that just return
strings" -- or something equivalent -- so that you can set variables
appropriately.
(b) This is a very simple example. Simple examples may well result in
smaller advantages.
(c) (Probably most important.) There is much greater flexibility here.
You can send a message to the target with an almost arbitrary argument
-- you're not limited to 'sender'. In a more complex example you could
have the argument as an array controller's selection's value
transformed whatever. And most of all, you can have more than one
argument...
mmalc
_______________________________________________
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.