I am having trouble getting the IB Action Invocation to work when using the Argument bindings. Can someone explain how this is meant to work. If I don't use the Argument binding then the binding works but the method is called with a nil parameter. I assume that the Argument binding is intended to set the parameter that will be passed in the method invocation. In my case I want to get a reference to the Table Cell Views object. I get a compiler error as follows:
Exception while running ibtool: *** -[__NSArrayM insertObject:atIndex:]: object cannot be nil
I am binding the action invocation to a Button in the Table Cell View.
Workaround:
In the Report Queue Table View Controller class:
NSTableViewDelegate
to the declaration. You don't have to implement any methods.@IBAction func cancelAction(_ sender: NSButton) {
let row = tableView.row(for: sender)
if let objects = arrayController.arrangedObjects as? [String] {
let object = objects[row]
cancel(object)
}
}
In IB:
cancelAction
of the Report Queue Table View Controller.