On 6. Nov 2006, at 17:55, Charilaos Skiadas wrote:

On Nov 6, 2006, at 4:45 PM, Allan Odgaard wrote:
• it is now possible to bind the target of a control to the controller key in the parameters object and set the selector to returnArgument:… adding named arguments according to argument bindings -- all arguments to this selector are then available in the dictionary returned under the result key of the returned property list.
Does this mean we don't have to subclass File's Owner and add performButtonClick: any more?

It’s an alternative to performButtonClick:, so you can use it instead -- though if you have a dummy.h file with these three lines:

    @interface NSObject (Category)
    - (IBAction)performButtonClick:(id)sender;
    @end

And drag that to the nib window in IB, then the method is available even w/o subclassing File’s Owner -- the new scheme is IMO a bit more work to setup, but allows arguments to be passed to the action method (which will find their way to the result returned).

The advantage of this is, that normally a control’s value can only be bound to one controller. Previously we would bind to NSObjectController, but for many controls, you really want to bind them to the shared user defaults controller, i.e. so that they are remembered for the next time the window is brought to front -- but by doing that, they are no longer returned in the result.

With this new scheme it is possible to bind the arguments of the action method also to the values stored in the user defaults.

Also, this is AFAIK the only way to hookup double clicks in table views to an action.


_______________________________________________
textmate-dev mailing list
[email protected]
http://lists.macromates.com/mailman/listinfo/textmate-dev

Reply via email to