Q: Why is my NSTableView 's "Action Invocation" binding not working?A: There could be several reasons why your action method is not being called: You may have not included a ":" with the selector name for the appropriate bindings. Some or all of the columns in the NSTableView are editable. This prevents the double-click action. Your NSArrayController might not be properly bound to the content of NSTableView .
NSTableView BindingsThe "Action Invocation" of NSTableView involves two different bindings: doubleClickArgument and doubleClickTarget . The binding doubleClickArgument is a multiple-value binding that specifies the object passed as a parameter to the selector when NSTableView receives a double click. The binding doubleClickTarget is an object that receives a message corresponding to the selector name. If your action method is defined in the Application's delegate, for example, use the following bindings for NSTableView using InterfaceBuilder: Action InvocationDouble Click Target Double Click Argument bind to = array controller controller key = selectedObjects selector name = clickAction:
Back to Top NSTableView ContentContent Selection Indexes Back to Top Define Your Action MethodWrite your action method with its argument as an NSArray of "selectedObjects ". Listing 1: Example action method.
- (void)clickAction:(NSArray*)selectedObjects
{
NSLog(@"double-click");
}
Back to Top Reference MaterialFor detailed information on NSTableView bindings refer to: Cocoa Bindings Reference - NSTableView Bindings Back to Top Document Revision HistoryDate | Notes |
---|
2006-11-13 | First Version |
Posted: 2006-11-13
|