Re: NSTableView Binding: Action Invocation
Re: NSTableView Binding: Action Invocation
- Subject: Re: NSTableView Binding: Action Invocation
- From: Scott Anguish <email@hidden>
- Date: Tue, 28 Mar 2006 12:41:31 -0800
On Mar 28, 2006, at 11:34 AM, Frederick C. Lee wrote:
I'm trying to attach an 'action Invocation ' to a NSTableView but
I'm confused about how to do it.
Essentially, I what to deliver the row value to the selector target
of the controller layer, that is, the Application Delegate.
So in essence: [NSTableView row] -- doubleClick ----> [process
value in appDelegate.m]
Do I use: 'double-click target' or 'double-click argument'? The
doc is a bit confusing.
I believe I should use 'double-click target'.
Scenario:
1) The NSTableColumn is bound to an NSArrayController.
2) I believe I should bind the NSTableView to the Application
Delegate where the method (selector) is located.
So my guess for the 'double-click target' parameters should be:
a) Bind to: 'Application Delegate';
b) Controller Key: 'selection'
c) Model Key Path: <optional> <-- not used.
d) Selector Name: 'ProcessDataRoutine'
the target option specifies the object that will receive the
message, along with the action that is called.
so, if you're action is in the Application Delegate
doubleClickAction
bind to Application Delegate
model key path - self
selector - clickAction:
the argument is coming from the array controller, so bind it to the
doubleClickArgument binding
doubleClickArgument
bind to array controller
controller key - selectionIndex
selector (should already be set to ) clickAction:
- (void)clickAction:(id)theParam
{
NSLog(@"hey %@",theParam);
return;
}
BTW, there is little win to this over just using the standard target-
action methods in this case.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden