Search code examples
objective-ccocoadelegatesnstableviewcocoa-bindings

Delegate/Outlet in NSTableCellView subview is null


I have a NSTableView that lists a number of NSTableCellView with a couple of subviews. Everything is set up with Cocoa bindings and works just as it's supposed to, until I tried to delegate from one of the subviews to the File's Owner. The delegating subview has an IBOutlet and it's connected to the File's Owner in IB, but when the subviews receives a mouseUp method call the delegate is null.

Any idea of why? Is this because I'm using bindings and Interface Builder? I've done similar things before when setting up up the NSTableView programmatically, setting the delegate like this: tableRowView.aSubView.delegate = self.


Solution

  • I just found this in my warnings: Outlet 'delegate' of 'MySubview' is connected to 'File's Owner,' an invalid destination (Objects inside view based table views may only be connected to the table view's delegate.). Setting the File's Owner as my table views delegate solved my problem.